473,799 Members | 2,907 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Chinese Characters in Page

Greetings All

I have a number of subdirectories, which are named as per the culture that
they refer to; for example the Italian folder is named it-IT. I then
generate a DropDownList on my ASPX page from this folder list. All languages
are displayed correctly in the HTML rendered by the DropDownList, excpet
Chinese (zh-CN), which displays as little squares. I've tried using a meta
tag to specify UTF-8 as the encoding for the page, and I've saved the page
as Unicode (UTF-8 with signature) - Codepage 65001, but to no avail. Can
anyone assist me in displaying the Chinese characters in this page?

There follows the code listing for my initialisation method for the
DropDownList:
------------------------------------------------------------------------------------------------------

private void InitLanguageSel ector()
{
foreach (DirectoryInfo dir in this.countryBan nerDirs)
{
string cultureString = dir.Name;
CultureInfo culture = new CultureInfo(cul tureString);
this.changeBann erLanguage.Item s.Add(
new ListItem(this.F ormatCountryNam e(culture.Nativ eName),
culture.ToStrin g()));
}
this.changeBann erLanguage.Sele ctedIndexChange d += new
EventHandler(ch angeBannerLangu age_SelectedInd exChanged);
}

------------------------------------------------------------------------------------------------------

The code listing for the method FormatCountryNa me() is as follows:

------------------------------------------------------------------------------------------------------

private string FormatCountryNa me(string culture)
{
string country = string.Empty;
try
{
int pos = culture.IndexOf (" ");
country = culture.Substri ng(0, pos);
char first = country[0];
first = char.ToUpper(fi rst);
country = first + country.Substri ng(1);
}
catch (Exception ex)
{
Base.GetEventLo gger().LogEvent (1, "9999",
"Banners::Forma tCountryName", ex);
}
return country;
}

------------------------------------------------------------------------------------------------------

Any assistance will be gratefully received.

Cheers!

--

Regards

Chris Marsh
May 1 '07 #1
3 1313
All

Sorry, I forgot to explicitly mention that the aim is to produce a
DropDownList where the text for each ListItem object is a language name in
that language. Therefore, the folder "en-GB" would have the ListItem with
the text "English", &c.
I have a number of subdirectories, which are named as per the culture that
they refer to; for example the Italian folder is named it-IT. I then
generate a DropDownList on my ASPX page from this folder list. All
languages are displayed correctly in the HTML rendered by the
DropDownList, excpet Chinese (zh-CN), which displays as little squares.
I've tried using a meta tag to specify UTF-8 as the encoding for the page,
and I've saved the page as Unicode (UTF-8 with signature) - Codepage
65001, but to no avail. Can anyone assist me in displaying the Chinese
characters in this page?

There follows the code listing for my initialisation method for the
DropDownList:
------------------------------------------------------------------------------------------------------

private void InitLanguageSel ector()
{
foreach (DirectoryInfo dir in this.countryBan nerDirs)
{
string cultureString = dir.Name;
CultureInfo culture = new CultureInfo(cul tureString);
this.changeBann erLanguage.Item s.Add(
new ListItem(this.F ormatCountryNam e(culture.Nativ eName),
culture.ToStrin g()));
}
this.changeBann erLanguage.Sele ctedIndexChange d += new
EventHandler(ch angeBannerLangu age_SelectedInd exChanged);
}

------------------------------------------------------------------------------------------------------

The code listing for the method FormatCountryNa me() is as follows:

------------------------------------------------------------------------------------------------------

private string FormatCountryNa me(string culture)
{
string country = string.Empty;
try
{
int pos = culture.IndexOf (" ");
country = culture.Substri ng(0, pos);
char first = country[0];
first = char.ToUpper(fi rst);
country = first + country.Substri ng(1);
}
catch (Exception ex)
{
Base.GetEventLo gger().LogEvent (1, "9999",
"Banners::Forma tCountryName", ex);
}
return country;
}

------------------------------------------------------------------------------------------------------

Any assistance will be gratefully received.

Cheers!

--

Regards

Chris Marsh


May 1 '07 #2
Hi Chris,

I believe you need to install required fonts to display Chinese characters,
if you're on Windows XP, please use following steps to install them:

1) Control Panel
2) Regional and Language Options
3) Tab "Languages" , check "Install files for East Asian languages"
4) Select OK
Please feel free to let me know if this works or not for you. Thanks.
Sincerely,
Walter Wang (wa****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

May 2 '07 #3
Walter
I believe you need to install required fonts to display Chinese
characters,
if you're on Windows XP, please use following steps to install them:
This was the solution - many thanks for your assistance, Walter!

[..]

--
Regards

Chris Marsh
May 2 '07 #4

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

Similar topics

1
4768
by: Jeff | last post by:
Having a problem displaying both german and chinese characters from a UTF-8 database on the same *.jsp page. Can make Chinese characters appear correctly by including the following lines: <%@ page pageEncoding="UTF-8" %> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
2
5180
by: Ian | last post by:
Hi, I've got an english site designed that I need to translate into Chinese. I've got the Chinese wording to work with but I can't figure out how to get it into my code. I thought I could simply paste the chinese characters from a Word document into my html editor between <P> tags using the PMingLiU or SimSun font but it just enters like this:
2
2276
by: Antonio Ooi | last post by:
Hi, Probably due to my 'Language for non-Unicode Setting' in Regional Settings, my ASP page keeps outputing the date format as Chinese Simplified characters when issuing say, <%=Now()%>. In addition, my client script also interpret it as Chinese characters, which I don't want it to behave this way. However, I can't remove my 'Chinese (PRC)' settings in control panel as I need it for other Chinese version software. Does anyone knows how...
6
22274
by: Zhang Weiwu | last post by:
Hello. I am working with a php software project, in it (www.egroupware.org) Chinese simplified locate is "zh" while Traditional Chinese "tw". I wish to send correct language attribute in http header, I found "zh" is not standard. I found this line in apache2's default httpd.conf # Simplified Chinese (zh-CN) AddLanguage zh-CN .zh-cn
1
2156
by: Antonio | last post by:
With the following page aspx I try to translate one my page from English to Chinese, using UTF8, the result Is that the Chinese characters do not come read correctly, if instead I insert directly the address http://babelfish.altavista.com/babelfish/trurl_pagecontent?url=http://www.etantonio.it/en/index.aspx&lp=en_zh into the browser the page he comes shown correctly in Chinese, if i save it and put it in my site and with the same below...
8
11993
by: pabv | last post by:
Hello all, I am having a few issues with encoding to chinese characters and perhaps someone might be able to assist. At the moment I am only able to see chinese characters when displayed as part of a datagrid. When an input textbox is displayed it does not display chinese characters, but rather the unicode characters stored in the mssql 2000 server backend.
4
6902
by: K | last post by:
I've an XML file in UTF-8. It contains some chinese characters ( both simplified chinese and traditional chinese). In loading the XML file with MSXML parser, I used the below code to retrieve the data in a node. The CString was then display in CListCtrl. For the traditional chinese characters, they were shown correctly, but for simplified characters, I encounted many "?", but some characters were correct.
1
2185
by: wtistang | last post by:
I need some suggestions regarding a problem I am facing. I have a web page (asp.net and C#) which containing Chinese characters. In my web.config file I have: <globalization requestEncoding="iso-8859-1" responseEncoding="iso-8859-1" fileEncoding="iso-8859-1" />
7
4313
by: c.verma | last post by:
I have a web application. There is a page which has a datagrid on it.The datagrid displays the data that comes from SAP. SAP sends the chinese characters to this grid. Before I display CHinese charactes, I have to use the following code to let it display on the web page: Public Function ToSCUnicode(ByVal str As String) As String Dim enc1252 As System.Text.Encoding = System.Text.Encoding.GetEncoding(1252) Dim arrByte_GBK As Byte() Dim...
15
1735
by: Lorenzo Stella | last post by:
Hi all, I haven't experienced functional programming very much, but now I'm trying to learn Haskell and I've learned that: 1) in functional programming LISTS are fundmental; 2) any "cycle" in FP become recursion. I also know that Python got some useful tool such as map, filter, reduce... so I told: "let's try some FP-style programming with Python!". I took a little example of Haskell: listprimes :: Integer -
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10473
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10249
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10025
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6804
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5584
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4138
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.