// 2byte¾ðÊó¤ò³ÊǼ¤¹¤ëÇÛÎó¤Î¥â¥¸¥å¡¼¥ë½ñ¤¤¤Æ¤ß¤Þ¤·¤¿ // °ú¿ô¤Ç»ØÄꤷ¤¿ÇÛÎó¤Ë // 1byteʸ»ú¢ª1 // 2byteʸ»ú¡¢ª2 // 2byteʸ»ú¢¢ª3 // ¤¬ÂåÆþ¤µ¤ì¤Þ¤¹ #module m_2byte_check #deffunc _2byte_check array tmp_d,var tmp_s tmp_l=strlen(tmp_s) dim tmp_d,tmp_l+1 i=0 while i < tmp_l n=peek(tmp_s,i) if ((n>=129)&(n<=159) )|( (n>=224)&(n<=252)){ tmp_d.i=2:i++ if tmp_l>i { tmp_d.i=3:i++ } }else{ tmp_d.i=1:i++ } wend return #global s="ab¤¢c" dim ar,4 _2byte_check ar,s repeat length(ar) mes ar.cnt loop