Connecting Tech Pros Worldwide Help | Site Map

Convert unicode to codepoint

  #1  
Old January 4th, 2007, 07:25 AM
tchengwee@gmail.com
Guest
 
Posts: n/a
Is there any function in visual c++ 6 to do the conversion from unicode
to codepoint? In vb, ascw can be used to do that.Thanks

  #2  
Old January 4th, 2007, 12:15 PM
flagos
Guest
 
Posts: n/a

re: Convert unicode to codepoint


Is there any function in visual c++ 6 to do the conversion from unicode
Quote:
to codepoint? In vb, ascw can be used to do that.Thanks
wchar_t * uni_buffer=L"Hello!";

wchar_t uni_character = uni_buffer[0];
wchar_t uni_character_2 = uni_buffer[1];


Is this what you need?

  #3  
Old January 5th, 2007, 03:55 AM
=?iso-8859-1?q?Kirit_S=E6lensminde?=
Guest
 
Posts: n/a

re: Convert unicode to codepoint



flagos wrote:
Quote:
Quote:
Is there any function in visual c++ 6 to do the conversion from unicode
to codepoint? In vb, ascw can be used to do that.Thanks
>
wchar_t * uni_buffer=L"Hello!";
>
wchar_t uni_character = uni_buffer[0];
wchar_t uni_character_2 = uni_buffer[1];
>
>
Is this what you need?
I think this only works if your wchar_t type is 32 bit. If it is 16 bit
then you will need to look out for surrogate pairs. As it looks like
he's using Windows wchar_t will be 16 bit.

I presume the OP wants something that converts to the "code page"
rather than "code point". There are some Windows API calls to do this
and some multibyte to wide character calls in the library too, all off
topic for here. Try Microsoft's VC group (don't remember the name, but
you'll find it on Google Groups without too much difficulty).


K

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
unicode to character Jason answers 4 January 27th, 2007 12:45 PM
Convert Unicode Codepoint(dec) value to ASCII char in C++(Linux)? Aneesh E Warrier answers 6 December 5th, 2006 11:55 AM
String to Integer Value Andy answers 7 November 17th, 2005 09:54 AM
converting html escape sequences to unicode characters harrelson answers 3 July 18th, 2005 07:33 PM