Jump to content

Unicode string to show in javascript alert()


cohq82

Recommended Posts

I am writing a script to parse a unicode string to show on the screen in alert(). However, I don't know of a way to convert something like

 

$text = "T& #236;m ki& #7871;m n& #226;ng cao";

 

into a unicode string within HTML so alert() can show the right thing.

 

I use the function below but no luck.

 

echo "<html><head>";

echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /></head><body>";

echo mb_convert_encoding(html_entity_decode("T& #236;m ki& #7871;m n& #226;ng cao"), 'UTF-8');exit;

 

The mbstring extension is enabled by the way!

 

What can I do? Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.