Module: Babosa::UTF8::JavaProxy

Extended by:
JavaProxy, Proxy
Included in:
JavaProxy
Defined in:
lib/babosa/utf8/java_proxy.rb

Overview

A UTF-8 proxy module using Java’s built-in Unicode support. Requires JRuby 1.5+.

Constant Summary

Constants included from Proxy

Proxy::CP1252

Instance Method Summary collapse

Methods included from Proxy

tidy_bytes

Instance Method Details

#downcase(string) ⇒ Object



9
10
11
# File 'lib/babosa/utf8/java_proxy.rb', line 9

def downcase(string)
  string.to_java.to_lower_case.to_s
end

#normalize_utf8(string) ⇒ Object



17
18
19
# File 'lib/babosa/utf8/java_proxy.rb', line 17

def normalize_utf8(string)
  Normalizer.normalize(string, Normalizer::Form::NFC).to_s
end

#upcase(string) ⇒ Object



13
14
15
# File 'lib/babosa/utf8/java_proxy.rb', line 13

def upcase(string)
  string.to_java.to_upper_case.to_s
end