473,386 Members | 1,773 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,386 software developers and data experts.

C$ and Chinese characters

I believe that C# uses Unicode by default for string characters. Does that
mean that double-byte langauges such as Chinese can be used without doing
anything special... including DB persistance? I.e., are all characters
automatically double-byte?
Sep 23 '07 #1
6 4272

"Bill Fuller" <so*****@nospam.comwrote in message
news:un**************@TK2MSFTNGP06.phx.gbl...
>I believe that C# uses Unicode by default for string characters. Does that
mean that double-byte langauges such as Chinese can be used without doing
anything special... including DB persistance? I.e., are all characters
automatically double-byte?
Yes. char and string are Unicode. Just make sure appropriate fonts are
installed on your computer so you can see them.

Sep 23 '07 #2
Bill Fuller wrote:
I believe that C# uses Unicode by default for string characters. Does that
mean that double-byte langauges such as Chinese can be used without doing
anything special... including DB persistance? I.e., are all characters
automatically double-byte?
C# internally uses Unicode.

When it comes to using database you will need to make sure it
is all done in Unicode (how depends on the database).

Arne
Sep 23 '07 #3
We will be using SQL Server 2005.

"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
Bill Fuller wrote:
>I believe that C# uses Unicode by default for string characters. Does
that mean that double-byte langauges such as Chinese can be used without
doing anything special... including DB persistance? I.e., are all
characters automatically double-byte?

C# internally uses Unicode.

When it comes to using database you will need to make sure it
is all done in Unicode (how depends on the database).

Arne

Sep 24 '07 #4
Bill Fuller wrote:
"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:46***********************@news.sunsite.dk...
>Bill Fuller wrote:
>>I believe that C# uses Unicode by default for string characters. Does
that mean that double-byte langauges such as Chinese can be used without
doing anything special... including DB persistance? I.e., are all
characters automatically double-byte?
C# internally uses Unicode.

When it comes to using database you will need to make sure it
is all done in Unicode (how depends on the database).
We will be using SQL Server 2005.
NVARCHAR/NCHAR/NTEXT as data types and teh SqlClient that
comes with .NET and I think you will be all set.

Arne
Sep 24 '07 #5
I believe that C# uses Unicode by default for string characters. Does that
mean that double-byte langauges such as Chinese can be used without doing
anything special... including DB persistance? I.e., are all characters
automatically double-byte?
Just to make sure there is no confusion about the double bytes:
If you mean double byte as in codepage 950: you will have to make sure
you work in C# with Unicode and not with 950. If you have for example
files in 950 which you need to convert, you will have to convert your
files before you use them in C#. You can do this easily by using the
StreamReader class with the constructor that specifies the encoding of
your files.

Unicode is double byte, but it doesn't mean that there is no need for
a conversion when using an older double byte system
Just make sure appropriate fonts are installed on your computer so you can see them.
If you work with Unicode, a standard Unicode font will do. The correct
fonts problem is actually a pre-Unicode problem.
You needed for example a CE font to display, for example, Hungarian
because the 1250 (Central Europe) en 1252 (Western Europe)
code pages have different code points: with a regular font, the 1250
code points would be mapped wrongly onto 1252 glyphs contained in the
regular font

Sep 24 '07 #6
This will be a new application so will not involve any conversion. Sounds
like we will be OK.

<jo*****@yamagata-europe.comwrote in message
news:11**********************@o80g2000hse.googlegr oups.com...
>I believe that C# uses Unicode by default for string characters. Does
that
mean that double-byte langauges such as Chinese can be used without doing
anything special... including DB persistance? I.e., are all characters
automatically double-byte?

Just to make sure there is no confusion about the double bytes:
If you mean double byte as in codepage 950: you will have to make sure
you work in C# with Unicode and not with 950. If you have for example
files in 950 which you need to convert, you will have to convert your
files before you use them in C#. You can do this easily by using the
StreamReader class with the constructor that specifies the encoding of
your files.

Unicode is double byte, but it doesn't mean that there is no need for
a conversion when using an older double byte system
>Just make sure appropriate fonts are installed on your computer so you
can see them.

If you work with Unicode, a standard Unicode font will do. The correct
fonts problem is actually a pre-Unicode problem.
You needed for example a CE font to display, for example, Hungarian
because the 1250 (Central Europe) en 1252 (Western Europe)
code pages have different code points: with a regular font, the 1250
code points would be mapped wrongly onto 1252 glyphs contained in the
regular font

Sep 24 '07 #7

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

Similar topics

1
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: <%@...
6
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...
8
by: Agnes | last post by:
In my .net ,i need to generate an xml file , however, user may input a chinese character, Then , the xml will got something unknow characters. the following is my code, Does anyone know how to...
8
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...
4
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...
1
by: paulineliu | last post by:
Hi, I would like to develop access databases for Chinese companies. I have microsoft access 2002 in windows XP. I am able to create labels in Chinese characters and enter Chinese characters in...
0
by: st.frey | last post by:
I've got a problem with importing chinese characters into a mysql-table and have read several mailings but didn't find a solution. i have a utf-8 text file that contains chinese characters. the...
5
by: Figmo | last post by:
I'm having a problem working with foreign characters (well....foreign to me anyway) I have a textbox control on a form. The font is set to MS Arial Unicode. If I use the Chinese input method...
2
by: Wassy | last post by:
Hi, i have a website which contains both chinese and english content which is stored in a database. Each record in the dB has an english and Chinese field. If a user enters a search string i have...
2
by: Flying Kite | last post by:
Hi All, I want to know how to print chinese characters on Zebra Printer, following code working fine with English string, but it's not working for Chinese string. It shows ASCII characters instead...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...

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.