By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,746 Members | 1,924 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,746 IT Pros & Developers. It's quick & easy.

Encode characters above ASCII 255

hsriat
Expert 100+
P: 1,654
If I need to encode characters below ASCII value 32, I can use this:[php]$text = filter_var($text, FILTER_UNSAFE_RAW, FILTER_FLAG_ENCODE_LOW);[/php]
How can I encode characters above ASCII value 256?
Feb 29 '08 #1
Share this Question
Share on Google+
4 Replies


pbmods
Expert 5K+
P: 5,821
Heya, hsriat.

For what medium are you encoding them?
Jun 4 '08 #2

hsriat
Expert 100+
P: 1,654
Hey pbmods,

Thanks for replying mate..

I figured this out later. It wasn't a problem with PHP encoding, but JavaScript encoding.
While posting something, if the user would include special characters like √, π, α, β, γ, δ, η... in his post, these characters would turn into the question mark things.

So this was the problem. But its completely out of my mind how did I come up with this question. Just, you know when thing are not working, you try even those things which don't have any relation.

So the actual reason was, while posting the text through Ajax, I was doing escape(), but it had to be encodeURIComponent().


Regards,
Harpreet
Jun 4 '08 #3

pbmods
Expert 5K+
P: 5,821
Heya, Harpreet.

Glad you were able to get it working! Good luck with your project.
Jun 4 '08 #4

hsriat
Expert 100+
P: 1,654
Good luck with your project.
Thank you

Jun 5 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.