Working with tab data and utf-8

Mark Schonewille m.schonewille at economy-x-talk.com
Tue Oct 25 12:47:41 EDT 2011


Hi Giuseppe,

For plain text, you can use:

set the itemDel to tab
put item 2 of theData into field "cif" of group "controles empresa"

I'm not sure that the UTF8 returned by MySQL is read correctly by LiveCode. If LiveCode reads it correctly, you can do:

set the unicodeText of fld "cif" of grp "controles empresa" to \
	uniEncode(item 2 of theData,"UTF8")

but if it isn't then you might need to make sure that MySQL returns plain text, by changing the encoding of your entire database.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

Become our partner in sales http://qery.us/16r Start selling Color Converter today. 20% commission!

On 25 okt 2011, at 18:37, Giuseppe wrote:

> Hi all,
> 
> I'm having a little problem I don't understand.
> 
> With this code....
>   put "SELECT * from empresas WHERE nif = '" & pID & "'" into theSQL
>   put revDataFromQuery(tab, cr, sDatabaseID, theSQL) into theData
> 
> I get this in a variable theData
> 
> 2    123456789    Empresa 2    Empresa 2    Dirección 2    Mucia    Murcia    30001    España    868987654    868987654
> 
> now, I need the second value. How can I get it?
> 
> I tried with
>   set the text of field "cif" of group "controles empresa" to the second column of theData
> 
> But I get a syntax Error.
> 
> Another problem I have is with ¿utf8?
> 
> In database, the fifth column with "Dirección 2" in database is "Dirección 2"
> 
> Regards.





More information about the Use-livecode mailing list