View Full Version : French accent in mysql database
gulluman1
12-14-2009, 07:23 PM
Hi,
I have a form submission into mysql table. The french accents are converted into something like this.
"Précédente" to "Précédente" in the database.
I set the page charset to iso-8859-1 and db field collation to 'utf8_unicode_ci' and type as 'varchar'.
Any way to get the accents as it is entered into the form to the database?
To be more precise, after the INSERT the database will contain data with the french accents. Is that possible?
Thanks in advance for your help.
djr33
12-15-2009, 04:06 AM
Make all encodings match: HTML, mysql and also the encoding of the .htm file itself. Unless you are specifically changing it like with htmlentities() then this is the problem. Iso is bad for foreign characters and Unicode is designed for that exact purpose.
gulluman1
12-16-2009, 07:04 PM
Hi, thanks for your reply.
I am doing it in php and the html part looks like this.
I have multipage forms that i built in php. It was initially UTF but the accents were getting messed up in the form fields once the person goes to review thier inputs. This is how my headings looks like.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta http-equiv="content-type"
content="text/html;charset=iso-8859-1" />
<meta http-equiv="Content-Style-Type" content="text/css" />
If i put utf-8...everything comes into weird language..all the accents are removed. iso-8859-1 seems to work perfect for forms. but the accents do not get written as it is in the database. i tried. utf-general and utf-bin..
djr33
12-16-2009, 07:34 PM
UTF-general should work for this. If it is not working, then it may be an issue tied to the system as a whole. Different encodings do not necessarily work well together, so you need to start with all new data. If you setup everything in utf, then insert new data and do whatever you need to with it, does it work then? If not, then there may be another issue with utf and, for example, submitting forms, but you need to not work with the old data.
Once you get a working system, you can of course find a way to import the old data back into it (if you need to save that), perhaps by cutting/pasting through a text editor if nothing else.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.