Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 12 made on Sunday December 30, 2007 at 06:43
frankbe
Long Time Member
Joined:
Posts:
December 2007
10
Here's a function to convert utf-8 to ascii i found somewhere on the web:

System.print(utfconf(descrip1));

prints the correct special characters on the debug panel. Unfortunately if you try to
assign the converted string to a label, there are the wrong chars again.

this seems to be a bug in the firmware as Barry Gordon mentioned in thread:
[PS] Displaying special characters
[Link: remotecentral.com]




Ciao
Frank


function utfconv(utftext)
{
var string = "";
var i = 0;
var c = c1 = c2 = 0;

while ( i < utftext.length ) {
c = utftext.charCodeAt(i);

if (c < 128) {
string += String.fromCharCode(c);
i++;
}
else if((c > 191) && (c < 224)) {
c2 = utftext.charCodeAt(i+1);
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
i += 2;
}
else {
c2 = utftext.charCodeAt(i+1);
c3 = utftext.charCodeAt(i+2);
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
i += 3;
}

}

return string;
}


Hosting Services by ipHouse