Connecting Tech Pros Worldwide Help | Site Map

Convert unicode to codepoint

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 4th, 2007, 06:25 AM
tchengwee@gmail.com
Guest
 
Posts: n/a
Default Convert unicode to codepoint

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, 11:15 AM
flagos
Guest
 
Posts: n/a
Default 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, 02:55 AM
=?iso-8859-1?q?Kirit_S=E6lensminde?=
Guest
 
Posts: n/a
Default 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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.