[windev] INI files and Russian
truckleaj-windev@yahoo.co.uk
truckleaj-windev at yahoo.co.uk
Sun Apr 19 18:48:21 GMT 2009
I am not getting very far with this:
{charszBuffer[_MAX_PATH];GetPrivateProfileStringA("labels", "lblhighlights"=
, "", szBuffer, _MAX_PATH, "c:\\test.ini");intlenA=3D lstrlenA(szBuffer);in=
tlenW;WCHAR*unicodestr;lenW=3D ::MultiByteToWideChar(1251, 0, szBuffer, len=
A, 0, 0);if(lenW> 0)unicodestr=3D newWCHAR[lenW];// Check whether conversio=
n was successful::
}MultiByteToWideChar(CP_ACP, 0, szBuffer, lenA, unicodestr, lenW);else{// h=
andle the error}
=A0
I don't understand it.
=A0
Why can't I take a INI file that I know is ANSI and contains Russian script=
and extract data from it into a CString in a unicode app?
=A0
At the moment the only way I get things working is by running my app inside=
MS AppLocale with Russian codepage.=A0 I have tried using 1251 as the code=
page and ity makes no difference.
=A0
I have googled for two days now and not come up with solution.
=A0
Andrew
________________________________
From: "truckleaj-windev at yahoo.co.uk" <truckleaj-windev at yahoo.co.uk>
To: windev at windev.org
Sent: Friday, 17 April, 2009 22:28:31
Subject: [windev] INI files and Russian
Hello
I try keep this brief and to the point.
My application is Unicode and is running in Russian.
It executes a 3rd party application which is not unicode and waits for it t=
o create a INI file.
This INI file is not unicode, but contains russian content.
The only way I can view the russian content as cryllic is by running notepa=
d inside ms applocale (set to russian) and then opening the INI file.
My problem is that my program is unicode. When I do GetPrivateProfileString=
with this ANSI text file, it is not providing me Russian cryllic content.
If I take the file that was opened in notepad (via ms applocale) and save a=
s unicode, and use that in my program, I get good cryllic output.
I can't change how the INI file is created as it is done by the 3rd party a=
pp. So is there a way that I can still use GetprivateProfileString with thi=
s ansi file inside my unicode app and end up with the unicode russian text?
I hope I am making sense.
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.windev.org/pipermail/windev/attachments/20090417/1c5e06e5=
/attachment.htm
-- =
Windev mailing list at Windev at windev.org
Lost your password?=A0 Need to unsubscribe or change your delivery options?=
=A0 =
Go to http://lists.windev.org/mailman/listinfo/windev
--
Search the Windev Archives - www.windev.org
delete[] unicodestr;=A0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.windev.org/pipermail/windev/attachments/20090419/749aa5ea=
/attachment.htm
More information about the Windev
mailing list