2004年03月11日 星期四 19:00
My python code will keep reading strings from a disk file. I wanna check if each string I read contains at least one Chinese character. Any easy way like theString.hasChinese()? __________________________________ Do you Yahoo!? Yahoo! Search - Find what youre looking for faster http://search.yahoo.com
2004年03月11日 星期四 19:22
It depends on which encoding the file use ... ------- Explicit is better than implicit ... -----Original Message----- From: Anthony Liu [mailto:antonyliu2002 at yahoo.com] Sent: 2004年3月11日 19:01 To: pycn Subject: [python-chinese] Any easy way to check if a string contains atleast one Chinese character? My python code will keep reading strings from a disk file. I wanna check if each string I read contains at least one Chinese character. Any easy way like theString.hasChinese()?
2004年03月12日 星期五 02:44
Hi, Jacob, The encoding is gbk. Any idea? --- Jacob Fan <jacob at exoweb.net> wrote: > It depends on which encoding the file use ... > > ------- > Explicit is better than implicit ... > > -----Original Message----- > From: Anthony Liu [mailto:antonyliu2002 at yahoo.com] > Sent: 2004年3月11日 19:01 > To: pycn > Subject: [python-chinese] Any easy way to check if a > string contains atleast one Chinese character? > > > My python code will keep reading strings from a disk > file. > > I wanna check if each string I read contains at > least > one Chinese character. > > Any easy way like theString.hasChinese()? > _______________________________________________ > python-chinese list > python-chinese at lists.python.cn > http://python.cn/mailman/listinfo/python-chinese __________________________________ Do you Yahoo!? Yahoo! Search - Find what youre looking for faster http://search.yahoo.com
2004年03月12日 星期五 08:44
Hello Anthony, ÏÈת»¯Îªutf-8 µÄ È»ºó ²âÊÔÊÇ·ñÓÐU+4E00 µ½ U+9FFF Ö®¼äµÄ×Ö·û¾ÍºÃ£¡ GB Big5 ¶¼·Ö²¼ÔÚÆäÖУ¡ === [ 2:44 ; 04-03-12 ] you wrote: AL> Hi, Jacob, AL> The encoding is gbk. Any idea? AL> --- Jacob Fan <jacob at exoweb.net> wrote: >> It depends on which encoding the file use ... >> >> ------- >> Explicit is better than implicit ... >> >> -----Original Message----- >> From: Anthony Liu [mailto:antonyliu2002 at yahoo.com] >> Sent: 2004年3月11日 19:01 >> To: pycn >> Subject: [python-chinese] Any easy way to check if a >> string contains atleast one Chinese character? >> >> >> My python code will keep reading strings from a disk >> file. >> >> I wanna check if each string I read contains at >> least >> one Chinese character. >> >> Any easy way like theString.hasChinese()? >> _______________________________________________ >> python-chinese list >> python-chinese at lists.python.cn >> http://python.cn/mailman/listinfo/python-chinese AL> __________________________________ AL> Do you Yahoo!? AL> Yahoo! Search - Find what youre looking for faster AL> http://search.yahoo.com === === === === === === === === === === -- Best regards, Zoom.Quiet /=======================================\ ]Time is unimportant, only life important![ \=======================================/
2004年03月12日 星期五 08:57
要的就是4e00 和9fff。多谢。 帮我看看那个书名号的问题? --- "Zoom.Quiet" <zoomq at infopro.cn> wrote: > Hello Anthony, > > 先转化为utf-8 的 > 然后 > 测试是否有U+4E00 到 U+9FFF 之间的字符就好! > > GB Big5 都分布在其中! > > > === [ 2:44 ; 04-03-12 ] you wrote: > > AL> Hi, Jacob, > > AL> The encoding is gbk. Any idea? > > AL> --- Jacob Fan <jacob at exoweb.net> wrote: > >> It depends on which encoding the file use ... > >> > >> ------- > >> Explicit is better than implicit ... > >> > >> -----Original Message----- > >> From: Anthony Liu > [mailto:antonyliu2002 at yahoo.com] > >> Sent: 2004年3月11日 19:01 > >> To: pycn > >> Subject: [python-chinese] Any easy way to check > if a > >> string contains atleast one Chinese character? > >> > >> > >> My python code will keep reading strings from a > disk > >> file. > >> > >> I wanna check if each string I read contains at > >> least > >> one Chinese character. > >> > >> Any easy way like theString.hasChinese()? > >> _______________________________________________ > >> python-chinese list > >> python-chinese at lists.python.cn > >> http://python.cn/mailman/listinfo/python-chinese > > > AL> __________________________________ > AL> Do you Yahoo!? > AL> Yahoo! Search - Find what you抮e looking for > faster > AL> http://search.yahoo.com > > === === === === === === === === === === > > -- > Best regards, > Zoom.Quiet > > /=======================================\ > ]Time is unimportant, only life important![ > \=======================================/ > > _______________________________________________ > python-chinese list > python-chinese at lists.python.cn > http://python.cn/mailman/listinfo/python-chinese __________________________________ Do you Yahoo!? Yahoo! Search - Find what youre looking for faster http://search.yahoo.com
Zeuux © 2024
京ICP备05028076号