How to find the codepage for a particular LCID ( language Identifier)

  • Thread starter Thread starter venkat9200
  • Start date Start date
V

venkat9200

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.
 
(e-mail address removed) wrote in
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top