0.0
No commit activity in last 3 years
No release in over 3 years
Convert MacJapanese string to UTF-8 and vice versa.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 0.7.0
~> 2.11.0
 Project Readme

mac_japanese

Convert MacJapanese string to UTF-8 and vice versa.

Installation

Add this line to your application's Gemfile:

gem 'mac_japanese'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mac_japanese

Usage

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"

Limitation

Ruby 1.8 (or earlier) is not supported.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request