Solved

Accentuation letters in Web forms and SQL

Posted on 2013-05-24
4
204 Views
Last Modified: 2013-07-23
Hello,

We are developing a web application (ASP) on a IIS server
The first thing is a registration form for users.
They fill in their first name, name, address etc... to register to our site.
The info is stored in a SQL database (SQL Server 2005)
Now what is strange is the following.
If the internet browse of the user is configured for characters encoding occidental windows 1252, data is ok in the database (we have a back-office system to see it)
But if the internet browse is configured unicode UTF-8, the accentuation letters in the database looks like "chinese"
How shall we fix this ?
Thanks
0
Comment
Question by:LeTay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 80

Expert Comment

by:David Johnson, CD, MVP
ID: 39195602
configure the database to use UTF-8 as well.
0
 

Author Comment

by:LeTay
ID: 39196816
Is it easy to reconfigure the database to use UTF-8 ?
And what about existing data an local backoffice applications ?
Thanks
0
 
LVL 80

Accepted Solution

by:
David Johnson, CD, MVP earned 500 total points
ID: 39196874
To go from utf-8 to sql's ucs-2
http://www.codeproject.com/Articles/21034/Implementation-of-Unicode-in-SQL-Server

types that support utf-8 are the n series i.e. nchar, nvchar and ntext in comparison with char,vchar and text

.net will also do the conversion for you

good discussion on stackoverflow http://stackoverflow.com/questions/1459395/microsoft-sql-server-2008-and-utf-8

SQL Server uses your local codepage by default.

And I was wrong in my idea that sql server understands UTF-8 ,,, it does and it doesn't maybe sticking with windows-1252 is the best idea.
0
 

Author Comment

by:LeTay
ID: 39197397
Well well
My concern is finally that some users do not use the code windows-1252 in their internet browser, but UTF-8
Is there a way, when they register themselves and type in a name with accents, that the server (ASP code) getting the data can put it correctly in SQL ?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here are the symptoms: You start receiving calls from users that one of your legacy web apps isn't coming up, so you log into your IIS 5 server to check it out.  When you pull up the services, you notice that the WWW Publishing service isn't runn…
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question