How I can see the correct char in SL and/or PHP of this string???
&#...
If I put here the string I see this ... Надявам but in SL I receive the codes
TYVM
These forums are CLOSED. Please visit the new forums HERE
Change Charset |
|
|
PedroRenaut Mariner
Registered User
Join date: 6 Nov 2006
Posts: 17
|
01-16-2009 15:53
How I can see the correct char in SL and/or PHP of this string???
&#... If I put here the string I see this ... Надявам but in SL I receive the codes TYVM |
|
Escort DeFarge
Together
Join date: 18 Nov 2004
Posts: 681
|
01-16-2009 17:40
Not sure I know the answer here, but pitching in anyhow. I believe the only format received in SL is text/plain so html entities won't be recognized -- you may try sending utf-8 and setting that as the charset on the raw text you're sending.
/esc _____________________
http://slurl.com/secondlife/Together
|
|
PedroRenaut Mariner
Registered User
Join date: 6 Nov 2006
Posts: 17
|
01-17-2009 04:06
My PHP return for example that...see http://www.slooger.com/ejemplo.txt
and I want receive ... Надявам се, че накрая нещо, което да послужи на всички промени, които имам, кой знае? Please ... Any idea??? TYVM |
|
PedroRenaut Mariner
Registered User
Join date: 6 Nov 2006
Posts: 17
|
01-17-2009 04:09
My PHP return for example... Надявам се, че накрая нещо, което да послужи на всички промени, които имам, кой знае? and I want receive ... Надявам се, че накрая нещо, което да послужи на всички промени, които имам, кой знае? Any idea??? |
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
01-17-2009 05:03
Working on it....
|
|
PedroRenaut Mariner
Registered User
Join date: 6 Nov 2006
Posts: 17
|
01-17-2009 06:12
TYVM Hewee ... I wait any solution in PhP (best) or in LsL. I continue working!!
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
01-17-2009 07:27
Here are some functions that will do it. Note that this is quite slow in LSL, even when compiled to Mono. I didn't realize that a PHP solution was acceptable to you. I believe there's a single function that'll do what you want. I'll try to find that too.
CODE
I get what look like the results you want (after a good few seconds of execution) using decodeAllHtmlEntities() on the contents of the document to which you linked. EDIT: Replaced some of the string processing with llParseStringKeepNulls() for faster performance. |
|
Pedro McMillan
SLOODLE Developer
Join date: 28 Jul 2007
Posts: 231
|
01-17-2009 07:36
We had major headaches for a while on SLOODLE when we started localizing stuff and enabling UTF8. It *is* possible to make PHP convert all your HTML entities to Unicode characters though. You need to start with this in your PHP script (before you output anything):
CODE
Without that, most webservers seem to default to ASCII, but note that particularly old webserver software (e.g. Apache 1) sometimes need other special configurations (or just a reinstallation) to make them work with UTF8. Anyhow, when you get your text in a PHP script, you then need to decode the entities back to ordinary characters, like this: CODE
|
|
PedroRenaut Mariner
Registered User
Join date: 6 Nov 2006
Posts: 17
|
01-17-2009 07:58
TYVM ... Now all run OK!!!
Perfect. |