divinequran Posted July 2, 2014 Share Posted July 2, 2014 Hello, I want to write some unicode "இயற்கை" values into a file in its real format like "இயற" Actually the browser prints the charactes in correct format, but I want it to be same in view source or browser source(இயற) but now the he browser displays it as (இயற்கை) $text = "இயற்கை"; $rest = utf8_decode($text); echo "$rest"; How to achieve this?Decode இயற்கை Quote Link to comment https://forums.phpfreaks.com/topic/289371-get-and-print-utf8-into-a-file/ Share on other sites More sharing options...
Jacques1 Posted July 2, 2014 Share Posted July 2, 2014 Why do you have those weird HTML entities at all? Where do they come from? As a workaround, you would use html_entity_decode(). But the question remains. Quote Link to comment https://forums.phpfreaks.com/topic/289371-get-and-print-utf8-into-a-file/#findComment-1483552 Share on other sites More sharing options...
Psycho Posted July 2, 2014 Share Posted July 2, 2014 Why do you have those weird HTML entities at all? Where do they come from? Why are letters in a language you don't understand "weird"? I believe those characters are from the Tamil language. Quote Link to comment https://forums.phpfreaks.com/topic/289371-get-and-print-utf8-into-a-file/#findComment-1483577 Share on other sites More sharing options...
Jacques1 Posted July 2, 2014 Share Posted July 2, 2014 I don't think you've understood my reply. I asked the OP why he/she gets tons of HTML entities as the input instead of the characters themselves. That's a rather odd way of dealing with UTF-8 data. No, I do not have a problem with non-latin characters. Quote Link to comment https://forums.phpfreaks.com/topic/289371-get-and-print-utf8-into-a-file/#findComment-1483580 Share on other sites More sharing options...
divinequran Posted July 3, 2014 Author Share Posted July 3, 2014 Thanks for reply, Yes they are tamil characters, The characters are encoded and the value is posted. The DB was not constructed earlier to accept it as itself of the characters. The browser itself decodes the value. html_entity_decode(); dosent work. Any other workaround to achieve this with generally available functions. Quote Link to comment https://forums.phpfreaks.com/topic/289371-get-and-print-utf8-into-a-file/#findComment-1483713 Share on other sites More sharing options...
Jacques1 Posted July 3, 2014 Share Posted July 3, 2014 html_entity_decode(); dosent work. It works perfectly. If you're having trouble with the function, then you're not using it correctly, or there's some other issue with your application. We might be able to help you, but then you have to give us information. What's your code? What's the problem? Remember that we don't have access to your server, so you need to actually tell us what's going on. Quote Link to comment https://forums.phpfreaks.com/topic/289371-get-and-print-utf8-into-a-file/#findComment-1483718 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.