Python论坛  - 讨论区

标题:[python-chinese] Any easy way to check if a string contains at least one Chinese character?

2004年03月11日 星期四 19:00

Anthony Liu antonyliu2002 at yahoo.com
Thu Mar 11 19:00:31 HKT 2004

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 you’re looking for faster
http://search.yahoo.com


[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2004年03月11日 星期四 19:22

Jacob Fan jacob at exoweb.net
Thu Mar 11 19:22:05 HKT 2004

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()?


[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2004年03月12日 星期五 02:44

Anthony Liu antonyliu2002 at yahoo.com
Fri Mar 12 02:44:16 HKT 2004

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 you’re looking for faster
http://search.yahoo.com


[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2004年03月12日 星期五 08:44

Zoom.Quiet zoomq at infopro.cn
Fri Mar 12 08:44:04 HKT 2004

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’re looking for faster
AL> http://search.yahoo.com

=== === === === === === === === === === 

-- 
Best regards,
 Zoom.Quiet                            

 /=======================================\
]Time is unimportant, only life important![
 \=======================================/



[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

2004年03月12日 星期五 08:57

Anthony Liu antonyliu2002 at yahoo.com
Fri Mar 12 08:57:35 HKT 2004

要的就是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 you’re looking for faster
http://search.yahoo.com


[导入自Mailman归档:http://www.zeuux.org/pipermail/zeuux-python]

如下红色区域有误,请重新填写。

    你的回复:

    请 登录 后回复。还没有在Zeuux哲思注册吗?现在 注册 !

    Zeuux © 2024

    京ICP备05028076号