diff --git a/lib/ffi-icu/uchar.rb b/lib/ffi-icu/uchar.rb index 2aafafa..26b80a1 100644 --- a/lib/ffi-icu/uchar.rb +++ b/lib/ffi-icu/uchar.rb @@ -1,10 +1,10 @@ -require 'iconv' - module ICU class UCharPointer < FFI::MemoryPointer def self.from_string(str) - super Iconv.conv("wchar_t", "utf-8", str.encode("UTF-8")) + # not sure how this will work with other encodings + str = str.encode("UTF-8") if str.respond_to? :encode + super str.unpack("U*").pack("L*") end end