Enc/euc_kr.c (euckr_mbc_enc_len) euc_kr.c is also used by CP942

[email protected]@%$G$9!#e(B


r15288 | akr | 2008-01-28 13:02:39 +0900 (Mon, 28 Jan 2008) | 2 lines

  • enc/euc_kr.c (euckr_mbc_enc_len): validation implemented.

e$B$3$l$Oe(B /[\x00-\x7F]|[\xA1-\xFE]{2}/
e$B0J30$r=3$k$H$$$&<q;][email protected]$H;W$&$N$Ge(B
e$B$9$,!“e(BEUC-KR e$B$Oe(B CP949 e$B$Ne(B replica e$B85$G$7$F!”$=$Ne(B
CP949 e$B$Oe(B \x81\x41 e$BEy$K$be(B
e$BJ8;z$,?6$C$F$"$k$N$G:$$j$^$9!#e(B
http://www.microsoft.com/globaldev/reference/dbcs/949.mspx

e$B8D?ME*$K$O!“e(Bstr.valid_encoding?
e$B$d$=$N<~JU$O$”$kDxEYBg;(GD$K$7$F$*$$$F!"e(B
validation
e$B$r4|BT$7$J$$$G$b$i$C$?J}$,K>$^$7$$$H;W$C$F$$$^$9!#!J$J$N$G!"e(B
valid e$B$H$$$&L>A0$OE,Ev$G$O$J$$$H;W$C$F$$$k!Ke(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:33452] enc/euc_kr.c (euckr_mbc_enc_len)
euc_kr.c is also used by CP942”
on Mon, 28 Jan 2008 17:26:31 +0900, “NARUSE, Yui”
[email protected] writes:

|* enc/euc_kr.c (euckr_mbc_enc_len): validation implemented.
|
|e$B$3$l$Oe(B /[\x00-\x7F]|[\xA1-\xFE]{2}/ e$B0J30$r=3$k$H$$$&<q;][email protected]$H;W$&$N$Ge(B
|e$B$9$,!“e(BEUC-KR e$B$Oe(B CP949 e$B$Ne(B replica e$B85$G$7$F!”$=$Ne(B CP949 e$B$Oe(B \x81\x41 e$BEy$K$be(B
|e$BJ8;z$,?6$C$F$"$k$N$G:$$j$^$9!#e(B
|http://www.microsoft.com/globaldev/reference/dbcs/949.mspx

e$BFq$7$$$b$N$G$9$M!#$3$3$O$f$k$a$kJ}8~$G$*4j$$$7$^$9!#e(B

|e$B8D?ME*$K$O!“e(Bstr.valid_encoding? e$B$d$=$N<~JU$O$”$kDxEYBg;(GD$K$7$F$*$$$F!"e(B
|validation e$B$r4|BT$7$J$$$G$b$i$C$?J}$,K>$^$7$$$H;W$C$F$$$^$9!#!J$J$N$G!"e(B
|valid e$B$H$$$&L>A0$OE,Ev$G$O$J$$$H;W$C$F$$$k!Ke(B

e$B$I$&$$$&L>A0$,NI$$$H;W$$$^$9$+!)e(B

[email protected]@%$G$9!#e(B

Yukihiro M. wrote:

|e$B8D?ME*$K$O!“e(Bstr.valid_encoding? e$B$d$=$N<~JU$O$”$kDxEYBg;(GD$K$7$F$*$$$F!"e(B
|validation e$B$r4|BT$7$J$$$G$b$i$C$?J}$,K>$^$7$$$H;W$C$F$$$^$9!#!J$J$N$G!"e(B
|valid e$B$H$$$&L>A0$OE,Ev$G$O$J$$$H;W$C$F$$$k!Ke(B

e$B$I$&$$$&L>A0$,NI$$$H;W$$$^$9$+!)e(B

e$B$o$?$7$N;W$$$D$$$?8B$j$G$O!“e(Bstr.well_formed? e$B$G$7$g$&$+!#e(B
XML e$B$G$O!”@07A<0$+H]$+$H!“e(Bschema
e$B$KE,9g$7$F$$$k$+H]$+$NFsCJ3,$N%A%’%C%/e(B
e$B$,$”$k$N$G$9$,!"$=$3$K$*$1$ke(B well_formed e$B$He(B validate
e$B$+$iN`?d$7$F$/$l$ke(B
e$B$3$H$r4|BT$7$F$$$^$9!#e(B

[email protected]@%$G$9!#e(B

Tanaka A. wrote:

[email protected]!"$=$N$X$s$NJ8;z$O$b$H$b$H0lJ8;z$H$7$F07$($F$J$+$C$?$s$8$ce(B
e$B$J$$$G$7$g$&$+!#e(B

% ./ruby -ve ‘p “\x81\x41”.force_encoding(“CP949”).length’
ruby 1.9.0 (2008-01-28 revision 15236) [i686-linux]
2

e$B$H$$$&$h$&$K!";d$,<j$r$D$1$kA0$+$i!"e(B\x81\x41 e$B$Oe(B 2e$BJ8;z$N07$$e(B
e$B$G$7$?!#e(B

e$B$`!“3N$+$K$=$&$G$9$M!#e(B
e$B:#e(B GBK/CP936 e$B$,e(B GB18030 e$B$Ne(B replica
e$B$G%k!<%:$9$.$k46$,$”$k$N$G!"$3$A$i$He(B
e$B$^$H$a$kJ}8~$G9M$($F$_$^$9!#e(B

In article [email protected],
“NARUSE, Yui” [email protected] writes:

e$B$3$l$Oe(B /[\x00-\x7F]|[\xA1-\xFE]{2}/ e$B0J30$r=3$k$H$$$&<q;][email protected]$H;W$&$N$Ge(B
e$B$9$,!“e(BEUC-KR e$B$Oe(B CP949 e$B$Ne(B replica e$B85$G$7$F!”$=$Ne(B CP949 e$B$Oe(B \x81\x41 e$BEy$K$be(B
e$BJ8;z$,?6$C$F$"$k$N$G:$$j$^$9!#e(B
http://www.microsoft.com/globaldev/reference/dbcs/949.mspx

e$B$J$k$[$I!#$=$l$O9M$($F$$$^$;$s$G$7$?!#e(B

[email protected]!"$=$N$X$s$NJ8;z$O$b$H$b$H0lJ8;z$H$7$F07$($F$J$+$C$?$s$8$ce(B
e$B$J$$$G$7$g$&$+!#e(B

% ./ruby -ve ‘p “\x81\x41”.force_encoding(“CP949”).length’
ruby 1.9.0 (2008-01-28 revision 15236) [i686-linux]
2

e$B$H$$$&$h$&$K!";d$,<j$r$D$1$kA0$+$i!"e(B\x81\x41 e$B$Oe(B
2e$BJ8;z$N07$$e(B
e$B$G$7$?!#e(B

e$B$^$?!"e(Bmbclen [email protected]$1$G$J$/!“e(BCP949 e$B$Oe(B 2byte e$BL$Ke(B
ASCII e$B$KAjEv$9e(B
e$B$k%P%$%H$,$”$k$N$G!"e(Beuckr_left_adjust_char_head e$B$b:#$N$^$^$Ge(B
e$B$O4|BT$7$?$h$&$K$OF0$+$J$$$s$8$c$J$$$G$7$g$&$+!#e(B

CP949 e$B$Ne(B 2e$B%P%$%HJ8;z$Oe(B
[\x81-\xfe][\x41-\x5a\x61-\x7a\x81-\xfe] e$B$NNN0h$K3d$jEv$F$ie(B
e$B$l$F$$$k$h$&$G$9$,!"$3$3$^$G$"$+$i$5$^$KNN0h$,0[$J$k$N$OJL!9e(B
e$B$KDj5A$9$Y$-$J$s$8$c$J$$$+$H$$$&5$$,$7$^$9!#e(B

e$B8D?ME*$K$O!“e(Bstr.valid_encoding? e$B$d$=$N<~JU$O$”$kDxEYBg;(GD$K$7$F$*$$$F!"e(B
validation e$B$r4|BT$7$J$$$G$b$i$C$?J}$,K>$^$7$$$H;W$C$F$$$^$9!#!J$J$N$G!"e(B
valid e$B$H$$$&L>A0$OE,Ev$G$O$J$$$H;W$C$F$$$k!Ke(B

e$BJ8;zC10L$K87L)$K$7$h$&$H$O;W$$$^$;$s$,!"%^%k%A%P%$%H%(%s%3!<e(B
e$B%G%#%s%0$N9=B$$O$A$c$s$HD4$Y$kI,MW$,$"$k$H;W$C$F$$$^$9!#$=$&e(B
e$B$7$J$$$H!"2u$l$F$$$kItJ,$re(B inspect e$B$G%(%9%1!<%W$9$k$3$H$b$Ge(B
e$B$-$^$;$s!#$D$$$G$K$$$($Pe(B succ [email protected]$7$$%(%s%3!<%G%#%s%0$NJ8;ze(B
e$B$rA$7=P$9$3$H$b$G$-$^$;$s!#$^$!!"e(Bsucc e$B$O$I$&$G$b$$$$$H$$$(e(B
e$B$P$$$$$N$G$9$,!#e(B

EUC-KR e$B$He(B CP949 e$B$rF1$8$K$9$k$H$$$&$N$OBg;(GD$K$7$F$b$d$j$9$.e(B
e$B$J$s$8$c$J$$$G$9$+$M$’!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:33456] Re: enc/euc_kr.c (euckr_mbc_enc_len)
euc_kr.c is also used by CP942”
on Mon, 28 Jan 2008 18:17:35 +0900, “NARUSE, Yui”
[email protected] writes:

|> e$B$I$&$$$&L>A0$,NI$$$H;W$$$^$9$+!)e(B
|
|e$B$o$?$7$N;W$$$D$$$?8B$j$G$O!“e(Bstr.well_formed? e$B$G$7$g$&$+!#e(B
|XML e$B$G$O!”@07A<0$+H]$+$H!“e(Bschema e$B$KE,9g$7$F$$$k$+H]$+$NFsCJ3,$N%A%’%C%/e(B
|e$B$,$”$k$N$G$9$,!"$=$3$K$*$1$ke(B well_formed e$B$He(B validate e$B$+$iN`?d$7$F$/$l$ke(B
|e$B$3$H$r4|BT$7$F$$$^$9!#e(B

e$B$&!<$s!"$=$NL>A0C1BN$J$ie(Bwell_formed?e$B$O$=$s$J$K0-$/$J$$$H;W$&e(B
e$B$N$G$9$,!“e(Bwell
formede$B$H$$$&C18l$O$”$^$j$K$b6/$/e(BXMLe$B$rA[5/$5$;e(B
e$B$k$N$G$O$J$$$+$H$$$&7|G0$,$"$j$^$9!#e(B

In article [email protected],
“NARUSE, Yui” [email protected] writes:

e$B:#e(B GBK/CP936 e$B$,e(B GB18030 e$B$Ne(B replica e$B$G%k!<%:$9$.$k46$,$"$k$N$G!"$3$A$i$He(B
e$B$^$H$a$kJ}8~$G9M$($F$_$^$9!#e(B

e$B$I$&$$$&J}8~$J$N$+$h$/$o$+$C$F$$$^$;$s$,!“e(BGB18030 e$B$,OC$K=P$Fe(B
e$B$-$?$N$G=q$$$F$*$/$H!”$3$l$K$be(B validation e$B$rF~$l$kM=Dj$G$9!#e(B

GB18030 e$B$Oe(B 2e$B%P%$%HL$rFI$^$J$$$HD9$5$,3NDj$7$J$$$3$H$,$"$k$Ne(B
e$B$G!":#$N$^$^[email protected]$He(B 2e$B%P%$%HL$,B8:_$7$J$$$H$-$KJQ$J$3$H$,$*$3$ke(B
[email protected]$,$"$j$^$9$7!#e(B

[email protected]@%$G$9!#e(B

Yukihiro M. wrote:

|e$B$3$H$r4|BT$7$F$$$^$9!#e(B

e$B$&!<$s!"$=$NL>A0C1BN$J$ie(Bwell_formed?e$B$O$=$s$J$K0-$/$J$$$H;W$&e(B
e$B$N$G$9$,!“e(Bwell formede$B$H$$$&C18l$O$”$^$j$K$b6/$/e(BXMLe$B$rA[5/$5$;e(B
e$B$k$N$G$O$J$$$+$H$$$&7|G0$,$"$j$^$9!#e(B

e$B$=$l$G$9$H!"e(Bed e$B$rMn$H$7$F!"e(Bwell_form? e$B$H$+!#e(BRuby
e$B$NL?L>J}?K$H$7$F$O$`$7e(B
e$B$m$3$A$i$NJ}$,E,$7$F$$$k5$$b$7$^$9$7!"8l46E*$Ke(B XML
e$B$+$iN%$l$^$9!#e(B

At 23:54 08/01/28, you wrote:

|> e$B$I$&$$$&L>A0$,NI$$$H;W$$$^$9$+!)e(B
e$B$=$l$G$9$H!"e(Bed e$B$rMn$H$7$F!"e(Bwell_form? e$B$H$+!#e(BRuby e$B$NL?L>J}?K$H$7$F$O$`$7e(B
e$B$m$3$A$i$NJ}$,E,$7$F$$$k5$$b$7$^$9$7!"8l46E*$Ke(B XML e$B$+$iN%$l$^$9!#e(B

well_formed? e$B$O0-$/$J$$$H;W$$$^$9!#e(Bwell_form?
e$B$OJ8K!E*$K9g$o$J$$5$$,$7$^$9!#e(B
form e$B$OL>;l$H<h$i$l$k$N$G!"e(Bgood_form?
e$B$NJ}$,J8K!E*$K$h$/$J$k$,!"e(B
e$B$=$l$G$b$A$g$C$H$I$&[email protected]$&5$$,$9$k!#4{$Ke(B valid?
e$B$,;H$o$l$k$N$G!"e(B
e$B$=$A$i$b2<<j$9$k$He(B XML
e$B$r0u>]$5$;$^$9$,!"N>J}$H$b0lHLE*[email protected]$J$N$G!"e(B
e$BLdBj$J$$$h$&$J5$$,$9$k!#e(B

e$B$H$3$m$G!"J8;z%3!<%IJQ49$G$b$3$NJU$j$r%A%’%C%/$7$F$$$^$9$N$G!"e(B
e$B>-Mh$b$7$+$7$FA4It$=$A$i$GC4Ev$7$F$b$$$$$+$J$H;W$$$^$7$?!#e(B

e$B59$7$/$*4j$$$7$^$9!#e(B Martin.

#-#-# Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University
#-#-# http://www.sw.it.aoyama.ac.jp mailto:[email protected]

[email protected]@%$G$9!#e(B

Martin D. wrote:

e$BLdBj$J$$$h$&$J5$$,$9$k!#e(B
e$B$"$!!"$=$&$$$($Pe(B well e$B$OI{;l$+!#$=$l$J$ie(B well_formed?
e$B$,$$$$$N$G$9$+$M!#e(B

e$B$H$3$m$G!"J8;z%3!<%IJQ49$G$b$3$NJU$j$r%A%’%C%/$7$F$$$^$9$N$G!"e(B
e$B>-Mh$b$7$+$7$FA4It$=$A$i$GC4Ev$7$F$b$$$$$+$J$H;W$$$^$7$?!#e(B

Encoding e$BK\BN0J30$N2?$+e(B (transcode e$B$,M-NO8uJd$G$9$,e(B)
e$B$,$b$C$H87L)$Je(B
e$B%A%’%C%/$rDs6!$9$k$h$&$K$J$C$?>l9g$N$?$a$K!“e(Bvalid?
e$B$O$”$1$F$*$-$?$$$H$$e(B
e$B$&[email protected]$C$?$j$O$7$^$9!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs