Get rid of iconv, collation now is reasonably fast

This commit is contained in:
Jari Bakken 2010-05-11 00:21:18 +02:00
parent 5ff5d67801
commit 52c8bbc838
1 changed files with 3 additions and 3 deletions

View File

@ -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