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

Problems character sets / special characters dot.Net <-> mssql-server

Hi,
I come from the "dark side" php/mysql and there often problems with
character sets (utf-8, latin...) and storing data in datebase.

Exists in the world of dot.net and ms-sql-server similiar problems?

To precise: I have to store xml-data in database. Maybe its better to
encode (like base64) the strings?

Perhaps there are some links to read?

Thanks.

klaus.
Feb 11 '08 #1
3 4337
You do not need to do any encoding. If you are using SQL Server 2000 then
you can use the NVARCHAR data type (which supports Unicode characters
http://en.wikipedia.org/wiki/Unicode) to store the XML.

SQL Server 2005 added native support for XML data type, which will makes it
the natural choice for storing XML:
http://msdn2.microsoft.com/en-us/library/ms345117.aspx
http://www.code-magazine.com/Article...uickid=0605081

HTH,

Plamen Ratchev
http://www.SQLStudio.com

Feb 11 '08 #2
Klaus Herzberg (kl***********@gmail.com) writes:
I come from the "dark side" php/mysql and there often problems with
character sets (utf-8, latin...) and storing data in datebase.

Exists in the world of dot.net and ms-sql-server similiar problems?
Character conversion is always a problem, if you don't do it right. :-)
To precise: I have to store xml-data in database. Maybe its better to
encode (like base64) the strings?
No, that is a not a good idea. SQL Server supports Unicode, and there is
also a native xml type (in SQL 2005). What you should be aware of that
SQL Server does not support UTF-8, but always store Unicode data in
UTF-16.

For character data you should use nchar/nvarchar which is Unicode
and not char/varchar which is the local 8-bit set.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Feb 11 '08 #3
thank you for help.
Feb 12 '08 #4

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

Similar topics

4
by: siliconmike | last post by:
All I know is that there are 8 bit numbers from 0 to 255 mapped to characters like A, B, C, D and some strange looking ones (like the ones used to make boxes in old PC text modes) all these being...
37
by: chandy | last post by:
Hi, I have an Html document that declares that it uses the utf-8 character set. As this document is editable via a web interface I need to make sure than high-ascii characters that may be...
3
by: Ekempd | last post by:
I'm trying to read the following XML file: <mail> <from>Rae</from> <subject>Informacion de su Proceso de Titulacion</subject> <body_mail> <!]> </body_mail> </mail>
7
by: teachtiro | last post by:
Hi, 'C' says \ is the escape character to be used when characters are to be interpreted in an uncommon sense, e.g. \t usage in printf(), but for printing % through printf(), i have read that %%...
4
by: Brian O'Haire | last post by:
Hi I am doing a project where I have to use multiple character sets for the input. They would be English, Symbol and possible Greek, These will be used as symbols for processing an algebraic...
18
by: james | last post by:
Hi, I am loading a CSV file ( Comma Seperated Value) into a Richtext box. I have a routine that splits the data up when it hits the "," and then copies the results into a listbox. The data also...
1
by: sonald | last post by:
Dear All, I am working on a module that validates the provided CSV data in a text format, which must be in a predefined format. We check for the : 1. Number of fields provided in the text file,...
17
by: =?Utf-8?B?R2Vvcmdl?= | last post by:
Hello everyone, Wide character and multi-byte character are two popular encoding schemes on Windows. And wide character is using unicode encoding scheme. But each time I feel confused when...
3
KevinADC
by: KevinADC | last post by:
Purpose The purpose of this article is to discuss the difference between characters inside a character class and outside a character class and some special characters inside a character class....
34
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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...

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.