Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/hprose/io.rb
Instance Method Summary collapse
- #ulength ⇒ Object (also: #usize)
- #utf8? ⇒ Boolean
Instance Method Details
#ulength ⇒ Object Also known as: usize
32 33 34 35 36 |
# File 'lib/hprose/io.rb', line 32 def ulength (a = unpack('U*')) rescue return -1 return -1 if a.find { |e| e > 0x10ffff } a.size + a.find_all { |e| e > 0xffff }.size end |
#utf8? ⇒ Boolean
28 29 30 31 |
# File 'lib/hprose/io.rb', line 28 def utf8? return false if unpack('U*').find { |e| e > 0x10ffff } rescue return false true end |