X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=chise%2Ficonv.rb;h=d361da685cccb987fb75eb510e161e4dd677d0d6;hb=5dac29593fc01dc74c6ddbb2f45830e417484101;hp=a55b6fa6bf3c8ed130334d6cf0f96efc1a9fa9fc;hpb=ffce8c4eb4a667debd47bfe237de4588414b0bb4;p=chise%2Fruby.git diff --git a/chise/iconv.rb b/chise/iconv.rb index a55b6fa..d361da6 100755 --- a/chise/iconv.rb +++ b/chise/iconv.rb @@ -77,29 +77,29 @@ class String def u16toeuc() Iconv.iconv_to_from("EUC-JP", "UTF-16", self) end def u16tosjis() Iconv.iconv_to_from("Shift_JIS", "UTF-16", self) end - def u32to_i - return 0 if length == 0 - s = self - return (s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]) - end - - def u8to_i - u32 = self.u8tou32 - u32.u32to_i - end +# def u32to_i +# return 0 if length == 0 +# s = self +# return (s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]) +# end + +# def u8to_i +# u32 = self.u8tou32 +# u32.u32to_i +# end end module CHISE - def i_tou32(n) # convert a integer to UTF-32 String - raise unless n.is_a?(Integer) - sprintf("%c%c%c%c", (n >> 24)&0xff, (n >> 16)&0xff, (n >> 8)&0xff, n&0xff) - end - - def i_tou8(n) # convert a integer to UTF-8 String - u32 = CHISE.i_tou32(n) - u32.u32tou8 - end - module_function :i_tou32, :i_tou8 +# def i_tou32(n) # convert a integer to UTF-32 String +# raise unless n.is_a?(Integer) +# sprintf("%c%c%c%c", (n >> 24)&0xff, (n >> 16)&0xff, (n >> 8)&0xff, n&0xff) +# end + +# def i_tou8(n) # convert a integer to UTF-8 String +# u32 = CHISE.i_tou32(n) +# u32.u32tou8 +# end +# module_function :i_tou32, :i_tou8 end class NuUconv