Conversion from iso-8859-15 (Latin9) to UTF-8 for mruby.
puts "F\xf6rdertechnik".from_latin9
# => "Fördertechnik"
puts 'Fördertechnik'.to_latin9
# => "F\xf6rdertechnik"
Note: The lib does not check if the string is already UTF-8 encoded. Converting a UTF-8 string from Latin-9 to UTF-8 results into a bad encoding result. You can use mruby-string-is-utf8 for that.
Add the line below to your build_config.rb
:
MRuby::Build.new do |conf|
# ... (snip) ...
conf.gem 'mruby-string-ext-latin9'
end
Or add this line to your aplication's mrbgem.rake
:
MRuby::Gem::Specification.new('your-mrbgem') do |spec|
# ... (snip) ...
spec.add_dependency 'mruby-string-ext-latin9'
end
Clone the repo:
$ git clone https://github.com/appplant/mruby-string-ext-latin9 && cd mruby-string-ext-latin9/
Compile the source:
$ rake compile
Run the tests:
$ rake test
Bug reports and pull requests are welcome on GitHub at https://github.com/appplant/mruby-string-ext-latin9.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
- Sebastián Katzer, Fa. appPlant GmbH
The mgem is available as open source under the terms of the MIT License.
Made with 😋 in Leipzig
© 2018 appPlant GmbH