473,395 Members | 1,418 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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.

Jan 18 '07 #1
1 3728
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
Jan 19 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Lauchlan M | last post by:
I'm retrieving url variable information uses the Request.QueryString object, eg: if (Request.QueryString.HasKeys()) key { lblMyResult.Text = Request.QueryString; } else {
4
by: CodeRazor | last post by:
I am reading an xml file from a URL. I was originally doing this using the XmlDocument class. But this was very slow. The XmlTextReader is meant to be much quicker for forward only retrieval of...
2
by: priya_sreejith | last post by:
how can we find whether a particular SQL recordset is present or not using VB ?
1
by: gopal | last post by:
Hi, Please can anyone tell what is lang-codepage peovided in VerQueryValue method when one is trying get the FileVersionInfo for a particular file - say DLL. I need a simple definition of...
2
by: DBC User | last post by:
I have a program which ccan be called multiple times. Each time, it will open a window and the windows title has unique name. I do not have any control over this program. I want to know is there a...
1
by: chandanperl | last post by:
Hi I want to give a word from command line and search it in a file whether that word is present or not. Please help me.
0
by: BarryM | last post by:
vb 2005 Hi, in my program i have a rich text box with some text entered in by the user. While they are typing a timer is running that searches the rtb for a word which is "theword" in this case and...
3
by: gupta24 | last post by:
Hi how to find particualr string in current directory and all sub directories in unix(command promt). please help bye gupta
8
by: srig | last post by:
hi.. i hav created a form which gets empid as input and retrieve data from database and display information about employee.now wen i get empid as input i should check with d table tat empid shold...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.