Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kostya/encoding-kawai

EncodingKawai - little sintax sugar for ruby force_encoding, also working on 1.8.7.
https://github.com/kostya/encoding-kawai

Last synced: 20 days ago
JSON representation

EncodingKawai - little sintax sugar for ruby force_encoding, also working on 1.8.7.

Awesome Lists containing this project

README

        

EncodingKawai - little sintax sugar for ruby force_encoding, also working on 1.8.7.

gem 'encoding-kawai'

```ruby
str.utf8! # str.respond_to?(:force_encoding) ? str.force_encoding('utf-8') : str
str.binary! # str.respond_to?(:force_encoding) ? str.force_encoding('binary') : str
```

Extend object.
```ruby
require 'encoding-kawai/object'

[str1, str2].utf8!
{str1 => str2}.utf8!
...
```