]> git.saurik.com Git - wxWidgets.git/commit - tests/strings/crt.cpp
Allow calling wxStrchr() with a narrow string and wide character.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 28 Nov 2009 14:37:03 +0000 (14:37 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 28 Nov 2009 14:37:03 +0000 (14:37 +0000)
commit874dbd3a4a318bd7f34548b84cfe0aed9efa42d5
tree1753959cb15aaa3ce9a6f34a786737432740c6ce
parent85b1997c095b18cd5e9e54e9d39feaa71c5ffa06
Allow calling wxStrchr() with a narrow string and wide character.

Calls to wxStrchr(char-string, wide-char) would previously fail if wide
character couldn't be converted to a single character in the current locale
encoding. Change it to simply return NULL in this case as it's a safe and
useful generalization: a narrow string will never contain a wide character not
representable in the current locale.

Add wxUniChar::GetAsChar() to help with implementing this.

Closes #11487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62738 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
include/wx/unichar.h
include/wx/wxcrt.h
interface/wx/unichar.h
src/common/unichar.cpp
tests/strings/crt.cpp