Unicode from a PHP script in LiveCode 7.0
Posted: Fri Oct 17, 2014 10:31 pm
Hi LiveCoders!
I understand that in the forthcoming version 7.0, Unicode is handled differently than it has been in the past, and that uniEncode is deprecated.
Apologies in advance for the awkward way in which I have created a URL, so that I can provide a simple example on this forum.
I have created a very simple php script, which returns a string in Serbian:
<?php
header('Content-type: text/xml; charset=utf-8');
echo "Љубазни фењерџија чађавог лица хоће да ми покаже штос.";
?>
You can see that the charset is explicitly set to utf-8. However, when you execute the following line in the Message window...
put "htt" into tURL
put "p://" after tURL
put "dev.lexogram.c" after tURL
put "om/livecode/serbian." after tURL
put "php" after tURL
put URL tURL
... the output is not properly treated. Here it is:
–â—É–±–∞–∑–Ω–∏ —Ñ–µ—ö–µ—Ä—ü–∏—ò–∞ —á–∞—í–∞–≤–æ–≥ –ª–∏—Ü–∞ —Ö–æ—õ–µ –¥–∞ –º–∏ –ø–æ–∫–∞–∂–µ —à—Ç–æ—Å.
In LiveCode 7.0, and without using uniEncode, how should I treat the incoming string so that it appears correctly?
Thanks in advance,
James
I understand that in the forthcoming version 7.0, Unicode is handled differently than it has been in the past, and that uniEncode is deprecated.
Apologies in advance for the awkward way in which I have created a URL, so that I can provide a simple example on this forum.
I have created a very simple php script, which returns a string in Serbian:
<?php
header('Content-type: text/xml; charset=utf-8');
echo "Љубазни фењерџија чађавог лица хоће да ми покаже штос.";
?>
You can see that the charset is explicitly set to utf-8. However, when you execute the following line in the Message window...
put "htt" into tURL
put "p://" after tURL
put "dev.lexogram.c" after tURL
put "om/livecode/serbian." after tURL
put "php" after tURL
put URL tURL
... the output is not properly treated. Here it is:
–â—É–±–∞–∑–Ω–∏ —Ñ–µ—ö–µ—Ä—ü–∏—ò–∞ —á–∞—í–∞–≤–æ–≥ –ª–∏—Ü–∞ —Ö–æ—õ–µ –¥–∞ –º–∏ –ø–æ–∫–∞–∂–µ —à—Ç–æ—Å.
In LiveCode 7.0, and without using uniEncode, how should I treat the incoming string so that it appears correctly?
Thanks in advance,
James