Created
June 9, 2015 17:15
-
-
Save muffinista/b50d9c703b0b9cab05dd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class String | |
def to_full_width | |
offset = 65248 | |
self.each_byte.collect { |x| | |
[x == 32 ? 12288 : (x + offset)].pack("U").freeze | |
}.join("") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment