Flowdock
method

encode!

Importance_2
Ruby latest stable (v1_9_3_392) - 1 note - Class: String
encode!(*args) public

The first form transcodes the contents of str from str.encoding to encoding. The second form transcodes the contents of str from src_encoding to dst_encoding. The options Hash gives details for conversion. See String#encode for details. Returns the string even if no changes were made.

Show source
Register or log in to add new notes.
April 2, 2013 - (v1_9_3_392)
0 thanks

output GBK

‘I am 中国人’.encode(‘gbk’,‘utf-8’)