Re: issue with accents and mysql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Try
SHOW VARIABLES LIKE 'character_set%'

and verify your character set is latin1.

If not, see http://dev.mysql.com/doc/mysql/en/charset-database.html

On Tue, 15 Feb 2005 22:04:30 +0000, mario <chiari.hm@xxxxxxxxxxx> wrote:
> Hello,
> 
> please help me on the following issue.
> please reply to chiari.hm@xxxxxxxxxxx too.
> (I asked for help on the php-db ml, but nobody replied)
> 
> I have hacked the following function:
> function accents($text) {
>   global $export;
>   $search  = array ( 'à', 'è', 'ì', 'ò' , 'ù');
>   $replace = array ( '\\`{a}', '\\`{e}', '\\`{i}', '\\`{o}', '\\`{u}');
>   $export    = str_replace($search, $replace, $text);
>   return $export;
> }
> 
> It works fine, as long as I feed it with a string:
> accents('à') --> \`{a}
> 
> The issue is when I get 'à' from a mysql table.
> I.e., for some record of a mysql table Table, let à the value of the
> field Field, and say
> $result =  mysql_fetch_array($answer, MYSQL_BOTH),
> where $answer= mysql_query(SELECT * FROM Table).
> 
> Now accents($result['Field']) returns à (instead of \`{a}).
> Why? I have no idea.
> 
> Any hint is welcome.
> Thanks a lot
> mario
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux