473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Accented characters problem

I am trying to allow accented characters (ä, ü ö, ß) to be entered
into a mysql table. When I use a statement like

INSERT INTO mytable(stuff) values('ä, ü ö, ß3');

I get a row that looks like this: "ä, ü ö, ß3"

I have the table and the column set to "utf8_general_ci" encoding and I
am using PHP 4. All I am doing is taking the posted values from a form
and using mysql_real_escape_string to construct the statement listed
above. Is there some other type of encoding that I need to do before
submiting the mysql statement?

BTW, If I do that exact statement on the command line of mysql, it
works, so it is something happening between PHP and mysql.

Thanks!

Jun 20 '06 #1
2 3757
Jake wrote:
I am trying to allow accented characters (ä, ü ö, ß) to be entered
into a mysql table. When I use a statement like

INSERT INTO mytable(stuff) values('ä, ü ö, ß3');

I get a row that looks like this: "ä, ü ö, ß3"

I have the table and the column set to "utf8_general_ci" encoding and I
am using PHP 4. All I am doing is taking the posted values from a form
and using mysql_real_escape_string to construct the statement listed
above. Is there some other type of encoding that I need to do before
submiting the mysql statement?

BTW, If I do that exact statement on the command line of mysql, it
works, so it is something happening between PHP and mysql.

Thanks!


Yup ! Something sure is happening between PHP and MySql, namely your
connection.
Apart from the fact that your form might not be utf-8 encoded, your
connection might also use a default value, which is often latin1.

I ran into a similar issue the other day myself and wrote a little
article about it:
http://www.adviesenzo.nl/examples/ph...l_charset_fix/

I hope you'll find it helpful and if the suggested fix doesn't solve
your problem, you will probably find the solution in the articles which
I link to at the bottom of my article.

Good luck !
Juliette
Jun 20 '06 #2
On 2006-06-20 20:55:10 +0200, "Jake" <of****@gmail.com> said:
I am trying to allow accented characters (ä, ü ö, ß) to be entered
into a mysql table. When I use a statement like

INSERT INTO mytable(stuff) values('ä, ü ö, ß3');

I get a row that looks like this: "ä, ü ö, ß3"

I have the table and the column set to "utf8_general_ci" encoding and I
am using PHP 4. All I am doing is taking the posted values from a form
and using mysql_real_escape_string to construct the statement listed
above. Is there some other type of encoding that I need to do before
submiting the mysql statement?

BTW, If I do that exact statement on the command line of mysql, it
works, so it is something happening between PHP and mysql.
Thanks!


Did you try to utf8_encode() your variables? This is a PHP function
from the XML extension.

Jun 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Bernhard Georg Enders | last post by:
I'm using the php 'file' command to read the contents of an ASCII text file to a variable. The original text file contains some accented and special characters. The problem arises when I echo this...
1
by: Fuzzyman | last post by:
I've written an anagram finder that produces anagrams from a dictionary of words. The user can load their own dictionary. ( http://www.voidspace.org.uk/atlantibots/nanagram.html ) In order to...
14
by: Nicolas Bouillon | last post by:
Hi I would like to replace accentuel chars (like "é", "è" or "à") with non accetued ones ("é" -> "e", "è" -> "e", "à" -> "a"). I have tried string.replace method, but it seems dislike...
2
by: Remco van den Berg | last post by:
I'm running a MySQL database with one of tables holding the members of a volleybal club in the Netherlands. One the the fields in that table is holding the name of the players. How do I search...
10
by: John Byrne | last post by:
I have encountered a problem when certain European characters are included in the Querystring of an URL. If I have a URL like: ?param=AAà On the receiving page a simple Request() call returns...
2
by: nicolas_riesch | last post by:
I try to use python as the language in an asp page with Microsoft IIS 5.0. I have these two files, req_bad.asp and req_ok.asp ---------- req_bad.asp --------- <%@LANGUAGE=Python%> <%
4
by: Satish | last post by:
Hi Gurus, Please help me in this, I have tried all options available to me. (Option 1) I am making a simple request from VB.NET client to WBI generated WSDL and passing request parameters. The...
0
by: shintu | last post by:
Hallo, I am trying to write french accented characters é è ê in Excel worksheet using my perl script , But I am stuck here as I couldnt find a way of writing it !: My code: use strict;...
4
by: gsuns82 | last post by:
Hi all, I am facing a strange issue. i.e: I have a jsp page with an input text field where the user can enter searching value even along with Accented Characters.After that i...
3
by: Jake | last post by:
I am writing a script that allows people to upload a CSV file for processing and I am having trouble with accented characters. If a UTF-8 encoded file is uploaded, everything works fine. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.