views:

58

answers:

3

I have an html page were i can fill in some text and send (with javascript) this to an sql-database.

On my pc, everything works fine, but on another one (a french windows), it doesn't save my chars correctly.

french chars like é, è, â,.. were saved as 'É', or something like that.

I googled a lot but still did not found any solution, i'm also not able to reproduce the problem on my own pc..

A: 

Make sure that your html pages encoding is set to something like UTF-8, UTF-16, etc... Also make sure that your strings are escaped properly in javascript.

Myles
+2  A: 

"É" occurs when a character encoded in utf-8 (2 bytes) is read as latin (1 byte). The problem can be on the client side (e.g. by the use of escape) or on the server side (wrong parsing of the form's POST data, database encoding).

Alsciende
Beware: Until MS-SQL 2008, UTF-8 support was lacking.
Diodeus
A: 

You need to encode the file in ANSI. I do this my self. For example in notepad 2 you would click File->Encoding->ANSI and then save.

Jonathan Czitkovics