Since characters in most cases, a UCS2 encoded string can be represented as a UTF-16 string (in UTF-16 char with codes larger than 0x10000 is rarely used) I think that using Iconv is the best way to convert strings. Code example:
require 'iconv'
ic = Iconv.new 'UTF-8', 'UTF-16'
utf8string = ic.iconv ucs2string
source
share