Convert MacJapanese string to UTF-8 and vice versa.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install mac_japanese
require "mac_japanese" MacJapanese.to_utf8("\x82\x9F") # => "あ" MacJapanese.to_mac_japanese("あ") # => "\x82\x9F" # composed character # Convert with private using area character for reversible conversion thirteen = MacJapanese.to_utf8("\x85\xAB") # => "?XIII" MacJapanese.to_mac_japanese(thirteen) # => "\x85\xAB" # composed character # Convert without private using area character (irreversible conversion) thirteen = MacJapanese.to_utf8("\x85\xAB", use_pua: false) # => "XIII" MacJapanese.to_mac_japanese(thirteen) # => "XIII"
Ruby 1.8 (or earlier) is not supported.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request