Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi!

Please suggest on below issue.

I have unicode MFC application.

If CString contains any japanese text then i need not to show on title of the window.
How can i recongnize is this string contains japanese character ?

CString s = _T(" 春日井 隆夫");

Thanks
Sam.
Posted
Comments
Sergey Alexandrovich Kryukov 26-Feb-13 0:51am    
I don't know if you are from Japan or not, but if you are, you should know better... :-)
—SA

1 solution

I don't know the language, but I know a bit about Japanese writing systems. There is no a general "Japanese" Unicode subset, but there are separate Unicode subsets for Hiragana, Katakana, Kana and their variants (supplements, extensions and half-width forms). Please see:
http://www.unicode.org/charts/[^],
http://en.wikipedia.org/wiki/Hiragana[^],
http://en.wikipedia.org/wiki/Katakana[^],
http://en.wikipedia.org/wiki/Kana[^].

Using these articles (especially from http://Unicode.org, Wikipedia for general information), recognize the Unicode subset in the form of code point ranges, put this data in your code and write then your method(s) bases on this data. It's quite simple.

I would suggest to wrote not a Boolean function (Japanese or not), but instead, a function returning some classifier showing what Japanese writing system a given character belongs to. Introduce an enumeration type to describe it.

—SA
 
Share this answer
 
Comments
Mr Sam 26-Feb-13 7:35am    
Thank you! SA.
Sergey Alexandrovich Kryukov 26-Feb-13 11:56am    
You are very welcome.
Good luck, call again.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900