Method: Rednode::Process#_byteLength

Defined in:
lib/rednode/process.rb

#_byteLength(str, encoding = 'utf8') ⇒ Object



50
51
52
53
# File 'lib/rednode/process.rb', line 50

def _byteLength(str, encoding = 'utf8')
  chars = encoding == 'utf8' ? str.unpack('C*') : str.unpack('U*')
  chars.length
end