Page 1 of 1
Read data in datagrid with æøå
Posted: Wed Dec 21, 2016 2:05 am
by tusa
Hello everybody.
I have a datagrid as you see here:

- Udklip.JPG (14.65 KiB) Viewed 4617 times
When I try to readout the data it will look like this instead:
Sren Laursen
Kbenhavn
Klaus Kj
How can I readout the right letters?
Best regards Tue.
Re: Read data in datagrid with æøå
Posted: Wed Dec 21, 2016 3:52 pm
by Klaus
Dag Tue,
hm, just made a test with LC 8.1.2 on a german macOS 10.12.2 and it works as exspected!?
See attached screenshot.
What script are you using to read out the data?
Best
Klaus
Re: Read data in datagrid with æøå
Posted: Wed Dec 21, 2016 6:27 pm
by tusa
Hello Klaus.
I've now testet it as you did.
Internally it works without any problems.
I'm writing a client for CasparCG and when I send the data to the CasparCG the problem appears.
Brg Tue.
Re: Read data in datagrid with æøå
Posted: Wed Dec 21, 2016 6:38 pm
by Klaus
Dag Tue,
ah, so it looks like this is an textencoding problem!
What encoding is the "CasparCG" exspecting?
Also check the "textEncode" command in the dictionary!
Best
Klaus
Re: Read data in datagrid with æøå
Posted: Wed Dec 21, 2016 8:40 pm
by tusa
Probably it has something to do with the encoding of the text.
When I use text stored in fields to send to CasparCG I do like this:
Code: Select all
put the unicodeText of field "Navn" into cgNavnUni
put the unicodeText of field "Kreds" into cgKredsUni
put the unicodeText of field "Navn_2" into cgNavn_2Uni
put uniDecode (cgNavnUni, "UTF8") into cgNavnUtf8
put uniDecode (cgKredsUni, "UTF8") into cgKredsUtf8
put uniDecode (cgNavn_2Uni, "UTF8") into cgNavn_2Utf8
put cgNavnUtf8 into cgF0
put cgKredsUtf8 into cgF1
put cgNavn_2Utf8 into cgF2
and then I send cgF0, cgF1 and cgF2 to CasparCG without problems.
When I use data stored in a datagrid I do like this:
Code: Select all
put the dgHilitedLines of group "seqGrid" into theLine
put the dgDataOfLine[theLine] of group "seqGrid" into theDataA
put theDataA["f0"] into tf0Line
put theDataA["f1"] into tf1Line
put theDataA["f2"] into tf2Line
and then I send tf0Line, tf1Line and tf2Line to CasparCG and then there is problems.
But how do I convert the text then?
Re: Read data in datagrid with æøå
Posted: Wed Dec 21, 2016 8:50 pm
by Klaus
Hi Tue,
please note that most of the "unicode..." handlers, functions and properties are deprecated since version 7 in Livecode!
That means e.g. "unicodetext", "uniencode" and "unidecode"!
Use the "textencode/textdecode" functions instead.
Try this:
...
put the dgHilitedLines of group "seqGrid" into theLine
put the dgDataOfLine[theLine] of group "seqGrid" into theDataA
put textencode(theDataA["f0"],"UTF-8") into tf0Line
put textencode(theDataA["f1"],"UTF-8") into tf1Line
put textencode(theDataA["f2"],"UTF-8") into tf2Line
...
before sending the data to CasparCG.
Best
Klaus
Re: Read data in datagrid with æøå
Posted: Wed Dec 21, 2016 9:12 pm
by tusa
Hello Klaus.
Indeed, that was just what I needed!
Thank you so much!
I will defanatly return with other questions.
Best regards Tue.