Problems with Caracters from Livecode-Server

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ace16vitamine
Posts: 130
Joined: Fri Apr 13, 2018 1:53 pm

Problems with Caracters from Livecode-Server

Post by ace16vitamine » Thu Jul 02, 2020 12:28 pm

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

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7237
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Problems with Caracters from Livecode-Server

Post by jacque » Thu Jul 02, 2020 5:58 pm

Livecode requires UTF16, so you need to convert the incoming data using textDecode.

Code: Select all

put textDecode(it, "UTF8") 
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

ace16vitamine
Posts: 130
Joined: Fri Apr 13, 2018 1:53 pm

Re: Problems with Caracters from Livecode-Server

Post by ace16vitamine » Thu Jul 02, 2020 6:15 pm

OK but know the result is

Mrkische Strae

the chars are missing?

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Problems with Caracters from Livecode-Server

Post by bn » Thu Jul 02, 2020 8:32 pm

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

ace16vitamine
Posts: 130
Joined: Fri Apr 13, 2018 1:53 pm

Re: Problems with Caracters from Livecode-Server

Post by ace16vitamine » Thu Jul 02, 2020 8:54 pm

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"

ace16vitamine
Posts: 130
Joined: Fri Apr 13, 2018 1:53 pm

Re: Problems with Caracters from Livecode-Server

Post by ace16vitamine » Thu Jul 02, 2020 9:31 pm

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?

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4003
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: Problems with Caracters from Livecode-Server

Post by bn » Thu Jul 02, 2020 9:42 pm

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

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”