MySQL -> PHP Encoding / Decoding problem

If I have this in MySQL 5.x

08/2006 – Created a simulation program with
Java to simulate the behavior of small networks

How can I decode the UTF8 latin data to render correctly in PHP ?

Better still -- how can I fix the data in MySQL
Adam_m [ Mi, 02 April 2008 01:51 ] [ ID #1933985 ]

Re: MySQL -> PHP Encoding / Decoding problem

Adam_m wrote:
> If I have this in MySQL 5.x
>
> 08/2006 – Created a simulation program with
> Java to simulate the behavior of small networks
>
> How can I decode the UTF8 latin data to render correctly in PHP ?
>
> Better still -- how can I fix the data in MySQL
>

What's wrong with the data in MySQL? If it's wrong, it's because it was
inserted incorrecly.

As for rendering the data, PHP doesn't care. It's in the charset your
server indicating the page uses.

Try alt.apache.configuration (if this is Apache).

Alternatively, use the header() call to set the charset for a specific page.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex [at] attglobal.net
==================
Jerry Stuckle [ Mi, 02 April 2008 04:01 ] [ ID #1933998 ]

Re: MySQL -> PHP Encoding / Decoding problem

Adam_m wrote:

> If I have this in MySQL 5.x
>
> 08/2006 – Created a simulation program with
> Java to simulate the behavior of small networks
>
> How can I decode the UTF8 latin data to render correctly in PHP ?

That's not UTF-8 - that's HTML entities.

(BTW, don't mix "UTF-8" and "latin". Keep in mind that UTF-8 and Latin-1 are
quite opposites!)

--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-

Proudly running Debian Linux with 2.6.24-1-amd64 kernel, KDE 3.5.9, and PHP
5.2.5-3 generating this signature.
Uptime: 03:10:12 up 8 days, 13:51, 2 users, load average: 0.59, 0.59, 0.66
ivansanchez-alg [ Mi, 02 April 2008 03:11 ] [ ID #1934000 ]
PHP » comp.lang.php » MySQL -> PHP Encoding / Decoding problem

Vorheriges Thema: .htaccess authentication control via PHP
Nächstes Thema: Extract text and images from pdf file