Connecting Tech Pros Worldwide Help | Site Map

UTF-8 Problem

  #1  
Old November 10th, 2005, 06:15 PM
Piotr Usewicz
Guest
 
Posts: n/a
Hi...

I've got a silly problem. I'm using a MySQL 4.1 with UTF-8 charset.
phpMyAdmin with UTF-8 charset aswell. The problem is when I enter data
in phpMyAdmin or any other MySQL tool, I can't see non standard letter
in my app. But when I enter data in my app i can't see thos chars in
let's say phpMyAdmin. Notice that my app is UTF-8 aswell... Any ideas
what's wrong? (PHP 5.0.3)

TIA
Piotr Usewicz
  #2  
Old November 10th, 2005, 11:25 PM
Ja NE
Guest
 
Posts: n/a

re: UTF-8 Problem


Piotr Usewicz <piotr@layer22.com> wrote:
[color=blue]
> Hi...
>
> I've got a silly problem. I'm using a MySQL 4.1 with UTF-8 charset.
> phpMyAdmin with UTF-8 charset aswell. The problem is when I enter data
> in phpMyAdmin or any other MySQL tool, I can't see non standard letter
> in my app. But when I enter data in my app i can't see thos chars in
> let's say phpMyAdmin. Notice that my app is UTF-8 aswell... Any ideas
> what's wrong? (PHP 5.0.3)
>[/color]

I had simmilar problem and have solved it with just one line after
database connection:

mysql_pconnect($hostname, $username, $password)
mysql_select_db($database)

add this line:

mysql_query("SET NAMES 'utf8'");


--
Ja NE
http://fotozine.org/?omen=janimir
--
  #3  
Old November 11th, 2005, 12:05 PM
Piotr Usewicz
Guest
 
Posts: n/a

re: UTF-8 Problem


Ja NE napisał(a):[color=blue]
> Piotr Usewicz <piotr@layer22.com> wrote:
>
>[color=green]
>>Hi...
>>
>> I've got a silly problem. I'm using a MySQL 4.1 with UTF-8 charset.
>>phpMyAdmin with UTF-8 charset aswell. The problem is when I enter data
>>in phpMyAdmin or any other MySQL tool, I can't see non standard letter
>>in my app. But when I enter data in my app i can't see thos chars in
>>let's say phpMyAdmin. Notice that my app is UTF-8 aswell... Any ideas
>>what's wrong? (PHP 5.0.3)
>>[/color]
>
>
> I had simmilar problem and have solved it with just one line after
> database connection:
>
> mysql_pconnect($hostname, $username, $password)
> mysql_select_db($database)
>
> add this line:
>
> mysql_query("SET NAMES 'utf8'");
>
>[/color]
Thanks, i'll see whether it works or not ;]
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
UTF-8 encoding in AJAX web application. Allan Ebdrup answers 23 March 21st, 2007 03:05 PM
Converting from UTF-16 to UTF-32 Jimmy Shaw answers 7 August 1st, 2006 07:35 PM
Unicode and utf 8 /utf 16 archana answers 6 July 1st, 2006 09:25 AM
French "No" character entity Haines Brown answers 38 July 20th, 2005 04:20 PM
how to test text to see if maybe it is UTF-8???? lawrence answers 9 July 17th, 2005 10:12 AM