It work when out in brower! But when I save to file, nothing change! :)
Ruben van Engelenburg wrote:[color=blue]
> This is the same question that McHenry asked today.
> The answer is simple: use html_entity_dec ode():
>
>
> <?php
> echo html_entity_dec ode('Thuyền Và Biển');
> ?>
>
> HTH.
> Ruben.[/color]
Chung Leong wrote:[color=blue]
> ngocviet wrote:[color=green]
> > I have a text like this: "Thuyền Và Biển"
> > How to convert it to: "Thuyá»n Và Biển"
> > Please help![/color]
>
> What text char-set/encoding do you want the text to be?[/color]
ngocviet wrote:[color=blue]
> I want to convert it to UTF-8 encoding
>
>
> Chung Leong wrote:[color=green]
> > ngocviet wrote:[color=darkred]
> > > I have a text like this: "Thuyền Và Biển"
> > > How to convert it to: "Thuyá»n Và Biển"
> > > Please help![/color]
> >
> > What text char-set/encoding do you want the text to be?[/color][/color]
You will have to do it manually using preg_replace_ca llback(), as I
don't believe html_entity_dec ode() is capable of decoding such
entities. Here're the basics:
"Chung Leong" <chernyshevsky@ hotmail.com> wrote in message
news:1151591566 .326139.249300@ y41g2000cwy.goo glegroups.com.. .[color=blue]
>
> You will have to do it manually using preg_replace_ca llback(), as I
> don't believe html_entity_dec ode() is capable of decoding such
> entities. Here're the basics:
>
> $text = preg_replace_ca llback('/&#(d+);/',
> 'numeric_html_e ntity_replace', $text);
>
> function numeric_html_en tity_replace($m ) {
> $unicode = (int) $m[1];
> $utf8 = /* encode the Uncode value */
> return $utf8
> }
>
> The tricky part is converting the Unicode value to a UTF-8 string.[/color]
chr seems to be ASCII-only (which is kinda stupid if you think about it,
plenty of utf implementations these days) but "grey" had written a
workaround for it.
--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk spam@outolempi. net | Gedoon-S @ IRCnet | rot13(xvzzb@bhg byrzcv.arg)
>
chr seems to be ASCII-only (which is kinda stupid if you think about it,
plenty of utf implementations these days) but "grey" had written a
workaround for it.
>
>
--
"ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk spam@outolempi. net | Gedoon-S @ IRCnet | rot13(xvzzb@bhg byrzcv.arg)
Comment