php_joe Posted November 5, 2006 Share Posted November 5, 2006 Hi,I'm trying to use PHP to create a link with a chinese word in it that will open an iframe.The code that I'm using is this:[code]echo "<a href=\"./rightcard.php?word=$chinese_word\" target=\"iframe\">Link</a>";[/code]In the source code it looks like this:[code]<a href="./rightcard.php?word=动物" target=\"iframe\">Link</a>[/code]If it weren't for an iframe it would look like this in the URL bar:[code]http://test.org/index.php?word=加法[/code]But when I click on it the word comes up as "??"Joe Link to comment https://forums.phpfreaks.com/topic/26225-trouble-with-chinese-words/ Share on other sites More sharing options...
php_joe Posted November 5, 2006 Author Share Posted November 5, 2006 I guess I should make myself more clear:if the link is:[code]index?face=加法[/code]and the following page has:[code]echo "$face";[/code]Why would it output [b]???[/b]And is there anyway to get it to output the chinese word?Thanks!Joe Link to comment https://forums.phpfreaks.com/topic/26225-trouble-with-chinese-words/#findComment-119936 Share on other sites More sharing options...
realjumper Posted November 5, 2006 Share Posted November 5, 2006 What is the encoding on the page? Link to comment https://forums.phpfreaks.com/topic/26225-trouble-with-chinese-words/#findComment-120050 Share on other sites More sharing options...
btherl Posted November 6, 2006 Share Posted November 6, 2006 How about[code]echo htmlentities($face, ENT_QUOTES, 'UTF-8');[/code]Or, replace 'UTF-8' with one of:BIG5GB2312 BIG5-HKSCS Link to comment https://forums.phpfreaks.com/topic/26225-trouble-with-chinese-words/#findComment-120179 Share on other sites More sharing options...
JasonLewis Posted November 6, 2006 Share Posted November 6, 2006 that would be because of the language settings on your encoding, as realjumper pointed out. Link to comment https://forums.phpfreaks.com/topic/26225-trouble-with-chinese-words/#findComment-120224 Share on other sites More sharing options...
php_joe Posted November 6, 2006 Author Share Posted November 6, 2006 Thanks everyone, I should have known that... ::)Joe Link to comment https://forums.phpfreaks.com/topic/26225-trouble-with-chinese-words/#findComment-120317 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.