用于Unicode字符的strstr [英] strstr for Unicode characters

查看:145
本文介绍了用于Unicode字符的strstr的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


如何编写一个strstr函数来处理unicode字符?


是否有现有的实现/解决方案/ api这样做了吗?


任何指针都会受到赞赏。


谢谢..

Hi all,

How could one write an strstr function to work with unicode characters?

Are there existing implementations/solutions/api for doing so?

Any pointers would be appreciated.

Thanks ..

推荐答案



? Kelvin Moss <公里********** @ yahoo.com ?????? ??? ??????

新闻:11 ********************** @ p79g2000cwp.googlegr oups.com ...

? "Kelvin Moss" <km**********@yahoo.com?????? ??? ??????
news:11**********************@p79g2000cwp.googlegr oups.com...

大家好,


如何编写一个strstr函数来处理unicode字符?

是否有现有的实现/解决方案/ api这样做?


任何指针都将不胜感激。


谢谢..
Hi all,

How could one write an strstr function to work with unicode characters?

Are there existing implementations/solutions/api for doing so?

Any pointers would be appreciated.

Thanks ..



对于windows,有wcsstr。

检查
http://msdn.microsoft .com / library / de ... c _._ mbsstr.asp

-

Papastefanos Serafeim

For windows, there is wcsstr.
Check
http://msdn.microsoft.com/library/de...c_._mbsstr.asp

--
Papastefanos Serafeim


Kelvin Moss写道:
Kelvin Moss wrote:

大家好,


怎么能写一个strstr函数使用unicode字符?


是否有现有的实现/解决方案ons / api这样做了吗?


任何指针都会受到赞赏。


谢谢..
Hi all,

How could one write an strstr function to work with unicode characters?

Are there existing implementations/solutions/api for doing so?

Any pointers would be appreciated.

Thanks ..



您可以随时使用memcpy()或memmove()。

You could always use memcpy() or memmove().


#大家好,



#怎样才能编写一个strstr函数来处理unicode字符?



#是否存在这样的实现/解决方案/ api?


字符串函数在UTF-8编码的unicode上应该可以正常工作

字符 - 注意nonASCII字符的代码更大

比127 (或小于零)并且可能由多个字节表示。

对于类似于strstr的东西,它应该只查找没有嵌入零的字节

序列,它应该没问题虽然strchr

可能有问题。还有广泛的字符(wc ...)类型

和功能可用,可能是16位或

更宽的unicode字符。

-

SM Ryan http:/ /www.rawbw.com/~wyrmwif/

别说什么。特别是你。
# Hi all,
#
# How could one write an strstr function to work with unicode characters?
#
# Are there existing implementations/solutions/api for doing so?

String functions should work just fine on UTF-8 encoded unicode
characters - minding that nonASCII characters will have codes greater
than 127 (or less than zero) and might be represented by multiple bytes.
For something like strstr which should only be looking for byte
sequences without embedded zeros, it should be fine, while strchr
can be problematically. There is also wide character (wc...) type
and functions becoming available which will probably be 16 bit or
wider unicode characters.

--
SM Ryan http://www.rawbw.com/~wyrmwif/
Don''t say anything. Especially you.


这篇关于用于Unicode字符的strstr的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆