You are here: Re: character set problems « PHP Language « IT news, forums, messages
Re: character set problems

Posted by ED on 10/19/07 14:59

"Ian Hobson" <ian.hobson@ntlworld.com> wrote in message
news:ZA0Si.9934$7a2.3102@newsfe3-gui.ntli.net...
> Hi guys,
>
> I have a problem that I believe is related to character sets.
>
> I'm in the UK and I need to store £ (GBP currency symbol) in a MySQL
> database, using php, pull it out again and put it into a .pdf file.
>
> On my test machine everythign work fine - the text can be input in a
> text or textarea field, gets processed via mysql_real_escape_string on
> its way to the MySQl database, get stored as the single character
> according to phpMyAdmin. When the data is sent back to the screen both
> display and edit field contents appear correct. The code also create a
> dynamic dpf file, which contains the correct symbol and prints
> correctly.
>
> On the production machine things are slightly different. The character
> is altered as it is stored - an "A with a hat" character is stored
> before the pound symbol. Although this displays correctly on show and
> edit in the browser, the pdf has the "A with hat" symbol prepended,
> and this is also printed.
>
> Although there are small differences in versions between php, and
> apache between the two machines, there are no differences I can see in
> the character sets of database setup, my.ini/cnf , php.ini or
> httpd.conf files.
>
> They both have the database in Latin1 and connection as utf-8.
>
> The production machine is Ubuntu Server LTS "out of the box" (running
> as a VM). The test machine is Win2K with Apache2, PHP5 and MySQl
> 5.0.24a-community-nt - all fairly "out of the box".
>
> Anyone have an idea how I can trace the problem, or how to fix it?
>
> Thanks for your input.
>
> Ian


Hi Ian,
Have you tried utf8_decode() on the text prior to inserting into the DB?
http://uk.php.net/manual/en/function.utf8-decode.php

cheers
ED

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация