James Gray has written
articles on Unicode, UTF-8, and Ruby 1.8.7 and 1.9.2. They are important for reading.
With Ruby 1.8.7, we could add:
#!/usr/bin/ruby -kU require 'jcode'
and get partial support for UTF-8.
From 1.9.2 you can use:
as the second line of your source file, and this will show Ruby by default for UTF-8. We make gray recommendations with all the source from which we are writing now.
This will not affect the external encoding when reading / writing text, but only the encoding of the source code.
Ruby 1.9.2 does not extend the usual character classes \w , \w and \s to handle UTF-8 or Unicode. Like other comments and answers, in this case only the POSIX and Unicode characters in regex are used.
the tin man
source share