[#32945] Shift_JIS variants and UTF-16 support — "U.Nakamura" <usa@...>

こんにちは、なかむら(う)です。

22 messages 2008/01/07
[#32953] Re: Shift_JIS variants and UTF-16 support — Martin Duerst <duerst@...> 2008/01/07

中村さん、こんにちは。

[#32955] Re: Shift_JIS variants and UTF-16 support — Yukihiro Matsumoto <matz@...> 2008/01/07

まつもと ゆきひろです

[#32959] Re: Shift_JIS variants and UTF-16 support — "NARUSE, Yui" <naruse@...> 2008/01/07

成瀬です。

[#32960] Re: Shift_JIS variants and UTF-16 support — Yukihiro Matsumoto <matz@...> 2008/01/07

まつもと ゆきひろです

[#32992] ASCII is alias of US-ASCII; replica of dummy encoding is not a dummy — "NARUSE, Yui" <naruse@...>

成瀬です。

18 messages 2008/01/08
[#32994] Re: ASCII is alias of US-ASCII; replica of dummy encoding is not a dummy — Yukihiro Matsumoto <matz@...> 2008/01/09

まつもと ゆきひろです

[#32995] Re: ASCII is alias of US-ASCII; replica of dummy encoding is not a dummy — Martin Duerst <duerst@...> 2008/01/09

At 18:13 08/01/09, Yukihiro Matsumoto wrote:

[#33011] Re: ASCII is alias of US-ASCII; replica of dummy encoding is not a dummy — "NARUSE, Yui" <naruse@...> 2008/01/11

成瀬です。

[#33012] Re: ASCII is alias of US-ASCII; replica of dummy encoding is not a dummy — Yukihiro Matsumoto <matz@...> 2008/01/11

まつもと ゆきひろです

[#33014] Re: ASCII is alias of US-ASCII; replica of dummy encoding is not a dummy — "NARUSE, Yui" <naruse@...> 2008/01/11

成瀬です。

[#33015] Re: ASCII is alias of US-ASCII; replica of dummy encoding is not a dummy — Yukihiro Matsumoto <matz@...> 2008/01/11

まつもと ゆきひろです

[#33239] Re: [ruby-cvs:22386] Ruby:r15149 (trunk): * string.c (rb_str_each_char): move forward. — Tanaka Akira <akr@...>

In article <200801210259.m0L2x3CW017171@ci.ruby-lang.org>,

11 messages 2008/01/21
[#33240] Re: [ruby-cvs:22386] Ruby:r15149 (trunk): * string.c (rb_str_each_char): move forward. — Nobuyoshi Nakada <nobu@...> 2008/01/21

なかだです。

[#33303] Time#strftimeのエンコーディング — rubikitch@...

るびきちです。

13 messages 2008/01/23
[#33305] Re: Time#strftimeのエンコーディング — Yukihiro Matsumoto <matz@...> 2008/01/23

まつもと ゆきひろです

[#33368] summary of script encoding — "U.Nakamura" <usa@...>

こんにちは、なかむら(う)です。

22 messages 2008/01/25
[#33375] Re: summary of script encoding — Yukihiro Matsumoto <matz@...> 2008/01/25

まつもと ゆきひろです

[#33376] Re: summary of script encoding — "U.Nakamura" <usa@...> 2008/01/25

こんにちは、なかむら(う)です。

[#33387] HashからStructを作る — rubikitch@...

るびきちです。

19 messages 2008/01/25
[#33455] Re: HashからStructを作る — Yukihiro Matsumoto <matz@...> 2008/01/28

まつもと ゆきひろです

[#33505] Re: HashからStructを作る — rubikitch@... 2008/01/29

From: Yukihiro Matsumoto <matz@ruby-lang.org>

[#33507] Re: HashからStructを作る — Yukihiro Matsumoto <matz@...> 2008/01/29

まつもと ゆきひろです

[#33508] Re: HashからStructを作る — rubikitch@... 2008/01/29

From: Yukihiro Matsumoto <matz@ruby-lang.org>

[#33433] Win32OLE: set encoding to OLE string — "U.Nakamura" <usa@...>

こんにちは、なかむら(う)です。

16 messages 2008/01/28

[#33461] Failed to make ruby-1.8.6-p111 on MacOSX 10.5(Leopard) — MORITA Hideyuki <h-morita@...>

=1B$B?9ED$H?=3D$7$^$9!#=1B(B

19 messages 2008/01/28
[#33473] Re: Failed to make ruby-1.8.6-p111 on MacOSX 10.5(Leopard) — Nobuyoshi Nakada <nobu@...> 2008/01/28

なかだです。

[#33503] Re: Failed to make ruby-1.8.6-p111 on MacOSX 10.5(Leopard) — MORITA Hideyuki <h-morita@...> 2008/01/29

森田です。

[#33514] Re: Failed to make ruby-1.8.6-p111 on MacOSX 10.5(Leopard) — Nobuyoshi Nakada <nobu@...> 2008/01/29

なかだです。

[#33518] Re: Failed to make ruby-1.8.6-p111 on MacOSX 10.5(Leopard) — MORITA Hideyuki <h-morita@...> 2008/01/30

森田です。

[#33545] Re: Failed to make ruby-1.8.6-p111 on MacOSX 10.5(Leopard) — Ryutaro Amano <wn9r-amn@...> 2008/01/31

天野竜太郎と申します。

[#33546] Re: Failed to make ruby-1.8.6-p111 on MacOSX 10.5(Leopard) — MORITA Hideyuki <h-morita@...> 2008/01/31

森田です。

[#33547] Re: Failed to make ruby-1.8.6-p111 on MacOSX 10.5(Leopard) — Ryutaro Amano <wn9r-amn@...> 2008/01/31

天野です。

[#33551] Re: Failed to make ruby-1.8.6-p111 on MacOSX 10.5(Leopard) — MORITA Hideyuki <h-morita@...> 2008/01/31

森田です。

[#33488] 現在の script encoding の値を得る方法は? — Hidetoshi NAGAI <nagai@...>

永井@知能.九工大です.

20 messages 2008/01/29
[#33491] Re: 現在の script encoding の値を得る方法は? — Yukihiro Matsumoto <matz@...> 2008/01/29

まつもと ゆきひろです

[#33500] Re: 現在の script encoding の値を得る方法は? — Hidetoshi NAGAI <nagai@...> 2008/01/29

永井@知能.九工大です.

[#33501] Re: 現在の script encoding の値を得る方法は? — "NARUSE, Yui" <naruse@...> 2008/01/29

成瀬です。

[#33515] Re: 現在の script encoding の値を得る方法は? — Hidetoshi NAGAI <nagai@...> 2008/01/30

永井@知能.九工大です.

[#33516] Re: 現在の script encoding の値を得る方法は? — "NARUSE, Yui" <naruse@...> 2008/01/30

成瀬です。

[#33519] Re: 現在の script encoding の値を得る方法は? — Hidetoshi NAGAI <nagai@...> 2008/01/30

永井@知能.九工大です.

[#33522] Re: 現在の script encoding の値を得る方法は? — "NARUSE, Yui" <naruse@...> 2008/01/30

成瀬です。

[ruby-dev:33226] [PATCH] warnings of enc/trans/utf_16_32.c

From: Nobuyoshi Nakada <nobu@...>
Date: 2008-01-20 21:49:02 UTC
List: ruby-dev #33226
なかだです。

enc/trans/utf_16_32.cの警告を消すパッチです。自動生成ということ
なので、生成元にお願いします。

ちなみに、関数部分は手で書いたのではないかと思われるのですが、ど
のような扱いになっているのでしょうか。


Index: enc/trans/utf_16_32.c
===================================================================
--- enc/trans/utf_16_32.c	(revision 15146)
+++ enc/trans/utf_16_32.c	(working copy)
@@ -5,27 +5,30 @@
 
 static int
-fun_so_from_utf_16be(const unsigned char* s, unsigned char* o)
+fun_so_from_utf_16be(const char* s, char* o, struct rb_transcoding *td)
 {
-    if (!s[0] && s[1]<0x80) {
-        o[0] = s[1];
+    unsigned char s0 = s[0], s1 = s[1];
+
+    if (!s0 && s1<0x80) {
+        o[0] = s1;
         return 1;
     }
-    else if (s[0]<0x08) {
-        o[0] = 0xC0 | (s[0]<<2) | (s[1]>>6);
-        o[1] = 0x80 | s[1]&0x3F;
+    else if (s0<0x08) {
+        o[0] = 0xC0 | (s0<<2) | (s1>>6);
+        o[1] = 0x80 | (s1&0x3F);
         return 2;
     }
-    else if ((s[0]&0xF8)!=0xD8) {
-        o[0] = 0xE0 | s[0]>>4;
-        o[1] = 0x80 | ((s[0]&0x0F)<<2) | (s[1]>>6);
-        o[2] = 0x80 | s[1]&0x3F;
+    else if ((s0&0xF8)!=0xD8) {
+        o[0] = 0xE0 | s0>>4;
+        o[1] = 0x80 | ((s0&0x0F)<<2) | (s1>>6);
+        o[2] = 0x80 | (s1&0x3F);
         return 3;
     }
     else {
-        unsigned int u = (((s[0]&0x03)<<2)|(s[1]>>6)) + 1;
-        o[0] = 0xF0 | u>>2;
-        o[1] = 0x80 | ((u&0x03)<<4) | (s[1]>>2)&0x0F;
-        o[2] = 0x80 | ((s[1]&0x03)<<4) | ((s[2]&0x03)<<2) | (s[3]>>6);
-        o[3] = 0x80 | s[3]&0x3F;
+	unsigned char s2 = s[2], s3 = s[3];
+        unsigned int u = (((s0&0x03)<<2)|(s1>>6)) + 1;
+        o[0] = 0xF0 | (u>>2);
+        o[1] = 0x80 | ((u&0x03)<<4) | ((s1>>2)&0x0F);
+        o[2] = 0x80 | ((s1&0x03)<<4) | ((s2&0x03)<<2) | (s3>>6);
+        o[3] = 0x80 | (s3&0x3F);
         return 4;
     }
@@ -33,27 +36,32 @@ fun_so_from_utf_16be(const unsigned char
 
 static int
-fun_so_to_utf_16be(const unsigned char* s, unsigned char* o)
+fun_so_to_utf_16be(const char* s, char* o, struct rb_transcoding *td)
 {
-    if (!(s[0]&0x80)) {
+    unsigned char s0 = s[0], s1, s2, s3;
+
+    if (!(s0&0x80)) {
         o[0] = 0x00;
-        o[1] = s[0];
+        o[1] = s0;
         return 2;
     }
-    else if ((s[0]&0xE0)==0xC0) {
-        o[0] = (s[0]>>2)&0x07;
-        o[1] = ((s[0]&0x03)<<6) | s[1]&0x3F;
+    s1 = s[1];
+    if ((s0&0xE0)==0xC0) {
+        o[0] = (s0>>2)&0x07;
+        o[1] = ((s0&0x03)<<6) | (s1&0x3F);
         return 2;
     }
-    else if ((s[0]&0xF0)==0xE0) {
-        o[0] = (s[0]<<4) | (s[1]>>2)^0x20;
-        o[1] = (s[1]<<6) | s[2]^0x80;
+    s2 = s[2];
+    if ((s0&0xF0)==0xE0) {
+        o[0] = (s0<<4) | ((s1>>2)^0x20);
+        o[1] = (s1<<6) | (s2^0x80);
         return 2;
     }
-    else {
-        int w = (((s[0]&0x07)<<2) | (s[1]>>4)&0x03) - 1;
+    s3 = s[3];
+    {
+        int w = (((s0&0x07)<<2) | ((s1>>4)&0x03)) - 1;
         o[0] = 0xD8 | (w>>2);
-        o[1] = (w<<6) | ((s[1]&0x0F)<<2) | ((s[2]>>4)-8);
-        o[2] = 0xDC | ((s[2]>>2)&0x03);
-        o[3] = (s[2]<<6) | (s[3]&~0x80);
+        o[1] = (w<<6) | ((s1&0x0F)<<2) | ((s2>>4)-8);
+        o[2] = 0xDC | ((s2>>2)&0x03);
+        o[3] = (s2<<6) | (s3&~0x80);
         return 4;
     }
@@ -61,27 +69,30 @@ fun_so_to_utf_16be(const unsigned char* 
 
 static int
-fun_so_from_utf_16le(const unsigned char* s, unsigned char* o)
+fun_so_from_utf_16le(const char* s, char* o, struct rb_transcoding *td)
 {
-    if (!s[1] && s[0]<0x80) {
-        o[0] = s[0];
+    unsigned char s0 = s[0], s1 = s[1];
+
+    if (!s1 && s0<0x80) {
+        o[0] = s0;
         return 1;
     }
-    else if (s[1]<0x08) {
-        o[0] = 0xC0 | (s[1]<<2) | (s[0]>>6);
-        o[1] = 0x80 | s[0]&0x3F;
+    else if (s1<0x08) {
+        o[0] = 0xC0 | (s1<<2) | (s0>>6);
+        o[1] = 0x80 | (s0&0x3F);
         return 2;
     }
-    else if ((s[1]&0xF8)!=0xD8) {
-        o[0] = 0xE0 | s[1]>>4;
-        o[1] = 0x80 | ((s[1]&0x0F)<<2) | (s[0]>>6);
-        o[2] = 0x80 | s[0]&0x3F;
+    else if ((s1&0xF8)!=0xD8) {
+        o[0] = 0xE0 | s1>>4;
+        o[1] = 0x80 | ((s1&0x0F)<<2) | (s0>>6);
+        o[2] = 0x80 | (s0&0x3F);
         return 3;
     }
     else {
-        unsigned int u = (((s[1]&0x03)<<2)|(s[0]>>6)) + 1;
-        o[0] = 0xF0 | u>>2;
-        o[1] = 0x80 | ((u&0x03)<<4) | (s[0]>>2)&0x0F;
-        o[2] = 0x80 | ((s[0]&0x03)<<4) | ((s[3]&0x03)<<2) | (s[2]>>6);
-        o[3] = 0x80 | s[2]&0x3F;
+	unsigned char s2 = s[2], s3 = s[3];
+        unsigned int u = (((s1&0x03)<<2)|(s0>>6)) + 1;
+        o[0] = 0xF0 | (u>>2);
+        o[1] = 0x80 | ((u&0x03)<<4) | ((s0>>2)&0x0F);
+        o[2] = 0x80 | ((s0&0x03)<<4) | ((s3&0x03)<<2) | (s2>>6);
+        o[3] = 0x80 | (s2&0x3F);
         return 4;
     }
@@ -89,27 +100,32 @@ fun_so_from_utf_16le(const unsigned char
 
 static int
-fun_so_to_utf_16le(const unsigned char* s, unsigned char* o)
+fun_so_to_utf_16le(const char* s, char* o, struct rb_transcoding *td)
 {
-    if (!(s[0]&0x80)) {
+    unsigned char s0 = s[0], s1, s2, s3;
+
+    if (!(s0&0x80)) {
         o[1] = 0x00;
-        o[0] = s[0];
+        o[0] = s0;
         return 2;
     }
-    else if ((s[0]&0xE0)==0xC0) {
-        o[1] = (s[0]>>2)&0x07;
-        o[0] = ((s[0]&0x03)<<6) | s[1]&0x3F;
+    s1 = s[1];
+    if ((s0&0xE0)==0xC0) {
+        o[1] = (s0>>2)&0x07;
+        o[0] = ((s0&0x03)<<6) | (s1&0x3F);
         return 2;
     }
-    else if ((s[0]&0xF0)==0xE0) {
-        o[1] = (s[0]<<4) | (s[1]>>2)^0x20;
-        o[0] = (s[1]<<6) | s[2]^0x80;
+    s2 = s[2];
+    if ((s0&0xF0)==0xE0) {
+        o[1] = (s0<<4) | ((s1>>2)^0x20);
+        o[0] = (s1<<6) | (s2^0x80);
         return 2;
     }
-    else {
-        int w = (((s[0]&0x07)<<2) | (s[1]>>4)&0x03) - 1;
+    s3 = s[3];
+    {
+        int w = (((s0&0x07)<<2) | ((s1>>4)&0x03)) - 1;
         o[1] = 0xD8 | (w>>2);
-        o[0] = (w<<6) | ((s[1]&0x0F)<<2) | ((s[2]>>4)-8);
-        o[3] = 0xDC | ((s[2]>>2)&0x03);
-        o[2] = (s[2]<<6) | (s[3]&~0x80);
+        o[0] = (w<<6) | ((s1&0x0F)<<2) | ((s2>>4)-8);
+        o[3] = 0xDC | ((s2>>2)&0x03);
+        o[2] = (s2<<6) | (s3&~0x80);
         return 4;
     }
@@ -238,5 +254,5 @@ from_UTF_16BE = {
 };
 
-static rb_transcoder
+static const rb_transcoder
 rb_from_UTF_16BE = {
     "UTF-16BE", "UTF-8", &from_UTF_16BE, 4, 0,
@@ -403,5 +419,5 @@ to_UTF_16BE = {
 };
 
-static rb_transcoder
+static const rb_transcoder
 rb_to_UTF_16BE = {
     "UTF-8", "UTF-16BE", &to_UTF_16BE, 4, 1,
@@ -450,5 +466,5 @@ from_UTF_16LE = {
 };
 
-static rb_transcoder
+static const rb_transcoder
 rb_from_UTF_16LE = {
     "UTF-16LE", "UTF-8", &from_UTF_16LE, 4, 0,
@@ -456,5 +472,5 @@ rb_from_UTF_16LE = {
 };
 
-static rb_transcoder
+static const rb_transcoder
 rb_to_UTF_16LE = {
     "UTF-8", "UTF-16LE", &to_UTF_16BE, 4, 1,


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦

In This Thread

Prev Next