Solved

Accentuation letters in Web forms and SQL

Posted on 2013-05-24
4
203 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
  • 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Debug Tools to analyse IIS process: This article focus on taking memory dumps from IIS to determine which code is taking more time and to analyse which calls hangs/causes more CPU usage. To take dumps,download the following. Install1: To st…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

809 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