lib/ffi-icu/uchar.rb in ffi-icu-0.0.9 vs lib/ffi-icu/uchar.rb in ffi-icu-0.1.0
- old
+ new
@@ -7,11 +7,11 @@
def self.from_string(str)
str = str.encode("UTF-8") if str.respond_to? :encode
bytes = str.unpack("U*")
ptr = new bytes.size
- ptr.put_array_of_uint16 0, bytes
+ ptr.write_array_of_uint16 bytes
ptr
end
def initialize(size)
@@ -27,10 +27,10 @@
end
def string(length = nil)
length ||= size / TYPE_SIZE
- wstring = get_array_of_uint16(0, length)
+ wstring = read_array_of_uint16(length)
wstring.pack("U*")
end
end # UCharPointer