From: PRMARJORAM on 9 Sep 2009 10:44 Plus im using Visual Studio 2005 "PRMARJORAM" wrote: > Giovanni, I must have explained the problem pretty well as you pretty much > have understood it. Yes the webpage in this particular instance im > downloading is as you specified. > > <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> > > Ok using a Binary Viewer on the first cyrillic code in the <title> tag is > > CC B3 > > Which 'should' be a cyrillic capital M? > > I hope this helps. Thanks again. > > > > > > > "Giovanni Dicanio" wrote: > > > PRMARJORAM ha scritto: > > > My application is compiled in UNICODE. I am downloading webpages using > > > cyrillic characters for their content. Although these files themselves are > > > ASCII. > > [...] > > > My problem is my CString containing this content is WCHAR and so I need to > > > convert 2 consecutive WCHAR to a single WCHAR to then get the correct > > > cyrillic code to display. > > > > I think that what I previously wrote may not be the right answer to your > > question. > > > > Could it be possible for you to clarify a little better the format of > > the input string? > > > > For example, in the Cyrillic code page 1251 I read here: > > > > http://www.fingertipsoft.com/ref/cyrillic/cp1251.html > > > > there is a character like an upper-case "K" (code: 202 dec, 0xCA hex). > > > > How is this character stored in your input string? > > What are the values of the two WCHAR's that you want to convert to one > > single WCHAR, in this particular case? > > > > Thanks, > > Giovanni > >
From: PRMARJORAM on 9 Sep 2009 10:51 I may have misunderstood my problem at hand thanks to your input. I guess i dont need to convert 2 WCHAR to 1 WCHAR to get the UNICODE value of a cyrillic character. I need to specifiy the code page and call the functions you have suggested. I will try this out now. I cannot believe how challenging it has been to convert my app to UNICODE. But im neally there... :-) I hope. "Giovanni Dicanio" wrote: > PRMARJORAM ha scritto: > > My application is compiled in UNICODE. I am downloading webpages using > > cyrillic characters for their content. Although these files themselves are > > ASCII. > [...] > > My problem is my CString containing this content is WCHAR and so I need to > > convert 2 consecutive WCHAR to a single WCHAR to then get the correct > > cyrillic code to display. > > I think that what I previously wrote may not be the right answer to your > question. > > Could it be possible for you to clarify a little better the format of > the input string? > > For example, in the Cyrillic code page 1251 I read here: > > http://www.fingertipsoft.com/ref/cyrillic/cp1251.html > > there is a character like an upper-case "K" (code: 202 dec, 0xCA hex). > > How is this character stored in your input string? > What are the values of the two WCHAR's that you want to convert to one > single WCHAR, in this particular case? > > Thanks, > Giovanni >
From: Alexander Grigoriev on 9 Sep 2009 11:24 If you need to convert 2 WCHAR to 1 WCHAR (what does that mean, anyway?), you did something wrong before that. What encoding you have in those 2 WCHAR? If it's not UNICODE, you did something already wrong. If it's UNICODE< it would not be 2 WCHAR, unless these are Chinese characters. Blindly changing all CHAR to WCHAR in the course of converting an app to UNICODE is wrong. You need to know what data was there, and change the character type accordingly. "PRMARJORAM" <PRMARJORAM(a)discussions.microsoft.com> wrote in message news:E831D311-BC1F-4E47-916A-362EC2C0F675(a)microsoft.com... >I may have misunderstood my problem at hand thanks to your input. > I guess i dont need to convert 2 WCHAR to 1 WCHAR to get the UNICODE value > of a cyrillic character. I need to specifiy the code page and call the > functions you have suggested. I will try this out now. > > I cannot believe how challenging it has been to convert my app to UNICODE. > But im neally there... :-) I hope. > > "Giovanni Dicanio" wrote: > >> PRMARJORAM ha scritto: >> > My application is compiled in UNICODE. I am downloading webpages using >> > cyrillic characters for their content. Although these files themselves >> > are >> > ASCII. >> [...] >> > My problem is my CString containing this content is WCHAR and so I need >> > to >> > convert 2 consecutive WCHAR to a single WCHAR to then get the correct >> > cyrillic code to display. >> >> I think that what I previously wrote may not be the right answer to your >> question. >> >> Could it be possible for you to clarify a little better the format of >> the input string? >> >> For example, in the Cyrillic code page 1251 I read here: >> >> http://www.fingertipsoft.com/ref/cyrillic/cp1251.html >> >> there is a character like an upper-case "K" (code: 202 dec, 0xCA hex). >> >> How is this character stored in your input string? >> What are the values of the two WCHAR's that you want to convert to one >> single WCHAR, in this particular case? >> >> Thanks, >> Giovanni >>
From: PRMARJORAM on 9 Sep 2009 11:53 Believe me it has not been like that 'blindly'. At first it was all a new problem for me, i have been on this days and read many a forum and webpage and im still not there. Its a very complicated problem all in all. Its all a massive hangover from 8 bit machines. We are all blind to begin and its very much like grovelling around in the dark trying to put a jigsaw puzzle together.... Plus when you compile your app to UNICODE all your CStrings change to WCHAR and you call Wide versions of everything. But yes the input and output you need to consider carefully as it is still ASCII in my case. And yes i was completely wrong with my 2 WCHAR but thats all part of the discovery process. That its not UNICODE strictly speaking its windows code pages. "Alexander Grigoriev" wrote: > If you need to convert 2 WCHAR to 1 WCHAR (what does that mean, anyway?), > you did something wrong before that. > > What encoding you have in those 2 WCHAR? If it's not UNICODE, you did > something already wrong. If it's UNICODE< it would not be 2 WCHAR, unless > these are Chinese characters. > > Blindly changing all CHAR to WCHAR in the course of converting an app to > UNICODE is wrong. You need to know what data was there, and change the > character type accordingly. > > > "PRMARJORAM" <PRMARJORAM(a)discussions.microsoft.com> wrote in message > news:E831D311-BC1F-4E47-916A-362EC2C0F675(a)microsoft.com... > >I may have misunderstood my problem at hand thanks to your input. > > I guess i dont need to convert 2 WCHAR to 1 WCHAR to get the UNICODE value > > of a cyrillic character. I need to specifiy the code page and call the > > functions you have suggested. I will try this out now. > > > > I cannot believe how challenging it has been to convert my app to UNICODE. > > But im neally there... :-) I hope. > > > > "Giovanni Dicanio" wrote: > > > >> PRMARJORAM ha scritto: > >> > My application is compiled in UNICODE. I am downloading webpages using > >> > cyrillic characters for their content. Although these files themselves > >> > are > >> > ASCII. > >> [...] > >> > My problem is my CString containing this content is WCHAR and so I need > >> > to > >> > convert 2 consecutive WCHAR to a single WCHAR to then get the correct > >> > cyrillic code to display. > >> > >> I think that what I previously wrote may not be the right answer to your > >> question. > >> > >> Could it be possible for you to clarify a little better the format of > >> the input string? > >> > >> For example, in the Cyrillic code page 1251 I read here: > >> > >> http://www.fingertipsoft.com/ref/cyrillic/cp1251.html > >> > >> there is a character like an upper-case "K" (code: 202 dec, 0xCA hex). > >> > >> How is this character stored in your input string? > >> What are the values of the two WCHAR's that you want to convert to one > >> single WCHAR, in this particular case? > >> > >> Thanks, > >> Giovanni > >> > > >
From: Joseph M. Newcomer on 9 Sep 2009 14:29
CC B3 is not a recognizable encoding. The Russian symbol that displays as "M" is code U041C, and it does not encode into CC B3. CCB3 does not decode into anything recognizably Unicode, nor does B3CC. For more details and the ability to experiment, I suggest downloading my Locale Explorer from my MVP Tips site. You need to know the encoding. (Note that I tried using Windows-1251 as well). joe On Wed, 9 Sep 2009 07:42:01 -0700, PRMARJORAM <PRMARJORAM(a)discussions.microsoft.com> wrote: >Giovanni, I must have explained the problem pretty well as you pretty much >have understood it. Yes the webpage in this particular instance im >downloading is as you specified. > ><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> > >Ok using a Binary Viewer on the first cyrillic code in the <title> tag is > >CC B3 > >Which 'should' be a cyrillic capital M? > >I hope this helps. Thanks again. > > > > > > >"Giovanni Dicanio" wrote: > >> PRMARJORAM ha scritto: >> > My application is compiled in UNICODE. I am downloading webpages using >> > cyrillic characters for their content. Although these files themselves are >> > ASCII. >> [...] >> > My problem is my CString containing this content is WCHAR and so I need to >> > convert 2 consecutive WCHAR to a single WCHAR to then get the correct >> > cyrillic code to display. >> >> I think that what I previously wrote may not be the right answer to your >> question. >> >> Could it be possible for you to clarify a little better the format of >> the input string? >> >> For example, in the Cyrillic code page 1251 I read here: >> >> http://www.fingertipsoft.com/ref/cyrillic/cp1251.html >> >> there is a character like an upper-case "K" (code: 202 dec, 0xCA hex). >> >> How is this character stored in your input string? >> What are the values of the two WCHAR's that you want to convert to one >> single WCHAR, in this particular case? >> >> Thanks, >> Giovanni >> Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm |