UTF-8 Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Piotr Usewicz

    #1

    UTF-8 Problem

    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
  • Ja NE

    #2
    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("SE T NAMES 'utf8'");


    --
    Ja NE
    fotografija = zapisano svjetlom | fotozine = foto-e-zin

    --

    Comment

    • Piotr Usewicz

      #3
      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("SE T NAMES 'utf8'");
      >
      >[/color]
      Thanks, i'll see whether it works or not ;]

      Comment

      Working...