|
-
August 11th, 2008, 08:29 AM
#1
Half Width and Full Width Characters
Hi,
How is it possible to detect half-width and full-width versions of the same Japanese katakana character ?
In the following code snippet - both the half width version and the full-width version result in the same hexa-decimal value. So, how could one distinguish the half-width version from the full width one.
Code:
int _tmain(int argc, _TCHAR* argv[])
{
cout<<"This is data wil both halfwidth and full width characters"<<endl;
stringstream s;
s<<hex<<(unsigned int)'カ';
cout<<"Full width ka : "<<s.str().c_str()<<endl;
stringstream s2;
s2<<hex<<(unsigned int)'カ';
cout<<"Half width ka : "<<s.str().c_str()<<endl;
}
Both the half-width version and the full-width version of the character 'ka' returns 834a as the hexa value.
-
August 11th, 2008, 08:56 AM
#2
Re: Half Width and Full Width Characters
From what I could understand in the small article on the wikipedia page -
Code:
http://en.wikipedia.org/wiki/Halfwidth_and_Fullwidth_Forms,
it looks like the UNICODE representations of the half/fullwidth forms have different values for the same character.
So does that mean that we need to do a mbstowcs() or a mbtowc() and then maybe be in a position to distinguish ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|