Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Replace Non-Standard Characters?

Landing Normandy
Proposing 4968
Join date: 28 Nov 2005
Posts: 240
09-02-2008 13:41
I have a slight problem with strings sent from a PHP script to an object in world. Take this character for instance: ´

It displays fine in the HTML output from the script, and it displays fine if I paste it directly in to an LSL script, but I'm seeing it displayed like this when it's used in the string "Everybody´s":

Everybody´s

There are other examples that are worse, and I'm assuming it's something to do with not sending particular headers from PHP, but what? How can I get rid of this? I have no control over the characters that are sent as this is a feed from elsewhere.

Thanks for any and all help guys
_____________________
<VOTE PROPOSITION 4968/>
http://jira.secondlife.com/browse/VWR-4968
For SecondLife Builders who need better mapping for better building
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
09-02-2008 13:54
That's a classic case of UTF-8 text misidentified as iso-8859-1, so if you're lucky all you need to do is force the charset to utf-8.
Landing Normandy
Proposing 4968
Join date: 28 Nov 2005
Posts: 240
09-02-2008 14:08
In PHP or LSL?
_____________________
<VOTE PROPOSITION 4968/>
http://jira.secondlife.com/browse/VWR-4968
For SecondLife Builders who need better mapping for better building
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
09-02-2008 14:10
Probably before it gets to SL, fix up the content-type header.
Landing Normandy
Proposing 4968
Join date: 28 Nov 2005
Posts: 240
09-02-2008 20:46
Put this in to the PHP page before anything is echoed:

header('Content-type: text/html; charset=UTF-8');

Job done. Cheers
_____________________
<VOTE PROPOSITION 4968/>
http://jira.secondlife.com/browse/VWR-4968
For SecondLife Builders who need better mapping for better building