Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / September 2007

Tip: Looking for answers? Try searching our database.

C$ and Chinese characters

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill Fuller - 23 Sep 2007 16:44 GMT
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?
Michael A. Covington - 23 Sep 2007 17:35 GMT
>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.
Arne Vajhøj - 23 Sep 2007 19:56 GMT
> 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
Bill Fuller - 24 Sep 2007 04:04 GMT
We will be using SQL Server 2005.

>> 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
[quoted text clipped - 7 lines]
>
> Arne
Arne Vajhøj - 24 Sep 2007 04:19 GMT
>>> 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
[quoted text clipped - 5 lines]
>> 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
joachim@yamagata-europe.com - 24 Sep 2007 15:03 GMT
> 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
Bill Fuller - 24 Sep 2007 16:30 GMT
This will be a new application so will not involve any conversion. Sounds
like we will be OK.

>> I believe that C# uses Unicode by default for string characters. Does
>> that
[quoted text clipped - 23 lines]
> code points would be mapped wrongly onto 1252 glyphs contained in the
> regular font

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.