Solved

Accentuation letters in Web forms and SQL

Posted on 2013-05-24
4
196 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 78

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 78

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Suggested Solutions

Today I came across an interesting issue that had me pulling my hair out.  I was troubleshooting a new internal web site which uses integrated security instead of anonymous.  When browsing the site from my laptop, I was able to access it with no iss…
What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now