Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ C MFC
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 25-Feb-13 17:47pm
Mr Sam679
Comments
Sergey Alexandrovich Kryukov at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
Comments
Mr Sam at 26-Feb-13 7:35am
   
Thank you! SA.
Sergey Alexandrovich Kryukov at 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)

  Print Answers RSS
0 OriginalGriff 310
1 Sergey Alexandrovich Kryukov 176
2 PhilLenoir 164
3 Richard MacCutchan 160
4 Sharmanuj 146
0 Sergey Alexandrovich Kryukov 6,081
1 OriginalGriff 5,115
2 CPallini 2,473
3 Richard MacCutchan 1,597
4 Abhinav S 1,505


Advertise | Privacy | Mobile
Web03 | 2.8.140814.1 | Last Updated 26 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100