Module: E4U::Encode::Google
- Defined in:
- lib/e4u/encode/google.rb,
lib/e4u/encode/google/utf8/unicode.rb,
lib/e4u/encode/google/unicode/kddi_unicode.rb,
lib/e4u/encode/google/unicode/docomo_unicode.rb,
lib/e4u/encode/google/unicode/softbank_unicode.rb
Defined Under Namespace
Class Method Summary collapse
Class Method Details
.encode(str, from, to) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/e4u/encode/google.rb', line 7 def self.encode str, from, to raise unless from[:carrier] == :google case from[:encoding] when :utf8 from[:encoding] = :unicode Utf8.to_google_unicode(str) when :unicode encode_carrier str, from, to else raise end end |