Page 1 of 1

Problems with Caracters from Livecode-Server

Posted: Thu Jul 02, 2020 12:28 pm
by ace16vitamine
Dear all,

I have a smal problem with livecode-server and Characters from my DB...

If I put the URL 1.2.3.4/test.lc in my Mac Browser, I receive the correct answer:
Märkische Straße

But If i try to get this answer on my app I receive
M‰rkische Strafle

Code: Select all

  post tmyData to URL "http://1.2.3.4/test.lc"
  put it
But why? The environment is APACHE, MariaDB, Linux (but I have the same error if I try the same way on a Windows OS LC Server). The informations are stored in my DB with UTF-8.

Regs
Stefan

Re: Problems with Caracters from Livecode-Server

Posted: Thu Jul 02, 2020 5:58 pm
by jacque
Livecode requires UTF16, so you need to convert the incoming data using textDecode.

Code: Select all

put textDecode(it, "UTF8") 

Re: Problems with Caracters from Livecode-Server

Posted: Thu Jul 02, 2020 6:15 pm
by ace16vitamine
OK but know the result is

Mrkische Strae

the chars are missing?

Re: Problems with Caracters from Livecode-Server

Posted: Thu Jul 02, 2020 8:32 pm
by bn
Hi Stefan,

Code: Select all

put isotomac("M‰rkische Strafle")
from the message box gives the right answer.
You could try this. But why? I do not know. Guessing: it is a Windows encoded (ISO 8859-1)string?

Kind regards
Bernd

Re: Problems with Caracters from Livecode-Server

Posted: Thu Jul 02, 2020 8:54 pm
by ace16vitamine

Code: Select all

put isotomac("M‰rkische Strafle")
Result: Märkische Straße


But

Code: Select all

put isotomac(it)
Does work for Märkische Straße but I can not see € - Only 

The other think is this stack is later for my android app. Communication is easy:

Linux Server : Maria DB : UTF-8 : APACHE -> HTTPS Android

With the browser it is possible to see the informations right. Maybe do I need to create a HTML Header in front of the post to get the right format from webserver into LC?

Code: Select all

post tmyData to URL "http://1.2.3.4/client2.lc"

Re: Problems with Caracters from Livecode-Server

Posted: Thu Jul 02, 2020 9:31 pm
by ace16vitamine
And... If i put

Code: Select all

put "äöü"
in the .lc file of my webserver i can see this chars without any problems on my client. S

eems that they are wrong displayed after the SQL select. But why can I see the right chars (with sql select) in my browser? but not in the post command?

Re: Problems with Caracters from Livecode-Server

Posted: Thu Jul 02, 2020 9:42 pm
by bn
I am a bit out of my comfort zone here.
The only thing I can think of is how is the text encoded that goes into your database. It does not seem to be utf-8.
(If I understand correctly that you are retrieving textual data from your database)

Once the textencoding is clear there should be a way to transform it.

It could also be that isoToMac does not translate the Euro sign "€" correctly since that was introduced relatively recently.

If all other non-lower ascii characters translate via isotomac correctly then that could be the case.

Sorry, no solution to offer.

Kind regards
Bernd