String unicode to utf-8 charset in web agent

There are a solution for convert any variable string that use a Unicode format to converting in UTF-8?

I have a Agent that print a JSON data …

All work correctly …but if I print a special caracter(ex. è,ì,etc…) I see in my firebug console

that the caracter is bad…

The String in LS are Unicode Format…and I would translate this in UTF-8 before the print…

P.S. If I insert in the head of my agent this charset :

'Print |content-type: text/plain; charset=“iso8859-15”; |

All work and I see the special caracter…but this charset is incompatible with IE so that I must

convert the string in UTF-8 for a standard format of output.

Subject: string unicode to utf-8 charset in web agent

I have found a solution!

If I call the agent with this url…

?openagent&charset=UTF8

All work!!!

Bye Bye