You are here: Re[3]: [PHP] utf-8 in mysql but not outputting as utf-8 on web « PHP « IT news, forums, messages
Re[3]: [PHP] utf-8 in mysql but not outputting as utf-8 on web

Posted by Kenneth Andresen on 12/23/05 05:31

Hello Jonathan,

You probably don't have php5 compiled with mbstrings enabled, if you
have complied php5 with iconv instead you can try

iconv('utf-8' , 'html', $string);

I don't know what to recommend if you don't have any of these complied
into php5.

Best regards,
Kenneth

--

jonathan wrote:

> thanks, never used this function. the weird thing is that it's
> throwing a fatal error saying mb_convert_encoding is undefined. I'm
> running 5.0.4.
>
> hmmmm.....
>
>
>
> Fatal error: Call to undefined function: mb_convert_encoding() in /
> home/arclocal/public_html/preview/Inc/menu.class.php on line 1563
>
>
>
> On Dec 22, 2005, at 7:08 PM, Kenneth Andresen wrote:
>
>> Hello,
>>
>> why not simply convert the text to html
>>
>> mb_convert_encoding($string, 'html', 'utf-8');
>>
>>
>> Best regards,
>> Kenneth
>>
>>
>> jonathan wrote:
>>
>>> I'm inserting some info into a mysql table which has the charset
>>> set to utf-8.
>>>
>>> When I do a select via the command-line from mysql, it looks like
>>> this:
>>> Clams and mussels with Dijon-crème fraîche-saffron sauce
>>>
>>> assuming this is coming out in your email client ok, it should
>>> look good.
>>>
>>> On a web page, I set the charset to utf-8 via:
>>> header("Content-type: text/html; encoding: UTF-8");
>>> as the top-line
>>>
>>> I then do a select for this field and it outputs like this in the
>>> browser:
>>> Clams and mussels with Dijon-crème fraîche-saffron sauce
>>>
>>> I'm familiar with html encoding. As this is going to go to XML, I
>>> wanted to see if I could keep it in the native format. Am I doing
>>> something wrong on the web side why I won't display this
>>> correctly? Is there some Apache config I need to be aware of?
>>>
>>> thanks,
>>>
>>> jonathan
>>
>>
>>
>>
>>
>
>

 

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

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация