ve********@gmail.com wrote in
news:11**********************@q2g2000cwa.googlegro ups.com:
I need to find out how many bytes a particulat language text takes.
In my application i have a display limit for the unicode string.
So i need to find the no of bytes a particular language text takes and
truncate it to the my limit.
i found the CultureInfo class gives the information for a paricular
language id. But i cannot find any calss that gives the codepage(ANSI)
used for a particular LCID.
Even windows API functions to known the codepage for a particular LCID
will solve my problem
Please help me to solve this.
For a generic LCID use GetLocaleInfo with LOCALE_IDEFAULTANSICODEPAGE
(LOCALE_IDEFAULTCODEPAGE for OEM).
For the current LCID is easier: GetACP (for ansi) and GetOEMCP (for oem)
But if your limit is for Unicode strings you should not care about code pages
(or I don't understand exactly what you are trying to do)
--
Mihai Nita [Microsoft MVP, Windows - SDK]
http://www.mihai-nita.net
------------------------------------------
Replace _year_ with _ to get the real email