Unicode Conversion
-
Hi, I am working on Unicode conversion and getting a problem to convert a character in to UTF-8 format. can anybody suggest that how to do this conversion. Regs Vineet
Vineet Kumar Singhal Sr.Software Engineer Mumbai Tough Time Never last, but Tough People do.
-
Hi, I am working on Unicode conversion and getting a problem to convert a character in to UTF-8 format. can anybody suggest that how to do this conversion. Regs Vineet
Vineet Kumar Singhal Sr.Software Engineer Mumbai Tough Time Never last, but Tough People do.
SKVineet wrote:
I am working on Unicode conversion and getting a problem to convert a character in to UTF-8 format.
look at MultiByteToWideChar
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you
-
Hi, I am working on Unicode conversion and getting a problem to convert a character in to UTF-8 format. can anybody suggest that how to do this conversion. Regs Vineet
Vineet Kumar Singhal Sr.Software Engineer Mumbai Tough Time Never last, but Tough People do.
You'll need the text in UTF-16 first, then call
WideCharToMultiByte()
passing theCP_UTF8
value for the code page.--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
-
SKVineet wrote:
I am working on Unicode conversion and getting a problem to convert a character in to UTF-8 format.
look at MultiByteToWideChar
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you
MultiByteToWideChar()
is for converting to UTF-16 only.--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
-
MultiByteToWideChar()
is for converting to UTF-16 only.--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Michael Dunn wrote:
is for converting to UTF-16 only.
just a ?.... codepage argument take UTF -8 ?.. is MSDN documentation wrong?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you
-
Michael Dunn wrote:
is for converting to UTF-16 only.
just a ?.... codepage argument take UTF -8 ?.. is MSDN documentation wrong?
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you
The codepage argument to
MultiByteToWideChar()
says what the encoding of the MBCS string is.MultiByteToWideChar()
converts from that encoding to UTF-16.--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
-
You'll need the text in UTF-16 first, then call
WideCharToMultiByte()
passing theCP_UTF8
value for the code page.--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
Hi, I tried with that , but could not found the desired result. In fact the stepa which I followed are as: 1. First I got the characters in the rtf string for a character(say chinese) I typed. ex:\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fmodern\\fprq6\\fcharset134 SimSun;}}{\\colortbl ;\\red0\\green0\\blue0;}\\viewkind4\\uc1\\pard\\cf1\\lang5124\\f0\\fs20\\'cc\\'d8\\par}" This is for the character 特 2.Now I convert the character values in to equavalant unicode number, which I got for this is 29305. 3.Now I want to convert this unicode number in to equavalant UTF-8 character. Can u suggest something with this scenerio . Regs
Vineet Kumar Singhal Sr.Software Engineer Mumbai Tough Time Never last, but Tough People do.
-
Hi, I tried with that , but could not found the desired result. In fact the stepa which I followed are as: 1. First I got the characters in the rtf string for a character(say chinese) I typed. ex:\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fmodern\\fprq6\\fcharset134 SimSun;}}{\\colortbl ;\\red0\\green0\\blue0;}\\viewkind4\\uc1\\pard\\cf1\\lang5124\\f0\\fs20\\'cc\\'d8\\par}" This is for the character 特 2.Now I convert the character values in to equavalant unicode number, which I got for this is 29305. 3.Now I want to convert this unicode number in to equavalant UTF-8 character. Can u suggest something with this scenerio . Regs
Vineet Kumar Singhal Sr.Software Engineer Mumbai Tough Time Never last, but Tough People do.
LPCWSTR wszUTF16 = L"\x7279";
char szUTF8[16] = {0};WideCharToMultiByte(CP_UTF8, 0, wszUTF16, -1, szUTF8, 16, NULL, NULL);
--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ