dealing with utf8 encoded characters in html input tag

Go To StackoverFlow.com

1

I'm dynamically adding value of an input tag. The values are returned from the server, and at some cases they are UTF8 encoded. Long story, short, the value of input tags still keeps the encoded characters, rendering e.g. Sábado to the user.

In my span tags, the value is rendered as desired, meaning that 'Sábado' is outputted. I do use

<META http-equiv="Content-Type" content="text/html;charset=UTF-8">

How can I fix this?

thanks.

2012-04-04 07:56
by learnAndImprove


0

Those strings are not "UTF8 encoded", those are HTML entities.

Don't HTML escape the values. Possibly you're double-escaping them somewhere.
Hard to give more concrete advise without details about your code.

2012-04-04 08:01
by deceze
Actually, you answered my question, I was copy/pasting from a file I thought it was UTF-8 encoded. Do you know how I can translate html entities to utf8, any online converter, I'm googling without luck so far - learnAndImprove 2012-04-04 08:19
First Google result: http://centricle.com/tools/html-entities - deceze 2012-04-04 08:32
yes, sorry, I was searching by 'html entities to utf converter' bad query. Thank you again, decenz - learnAndImprove 2012-04-04 09:33
Ads