SQLite, Unicode & LC

Devin Asay devin_asay at byu.edu
Wed Apr 9 15:30:20 EDT 2014


On Apr 9, 2014, at 1:07 PM, Peter Haworth <pete at lcsql.com>
 wrote:

> On Wed, Apr 9, 2014 at 11:21 AM, Devin Asay <devin_asay at byu.edu> wrote:
> 
>>> Thanks Devin, I was wondering about that.  Will the above method still
>> work
>>> in 7?
>> 
>> I believe it will still work, but will be deprecated.
>> 
> 
> Hi Devin,
> Yes, just saw that in the 7.0 release notes.
> 
> I also see that there is a new form of the open file/process/socket
> commands to deal with different encodings but I didn't see anything
> equivalent when using the get/put URL commands to read a file.  I use those
> commands a lot to read files so wondering if they will be able to handle
> different encodings?

Saving:

on mouseUp
    ask file "Save to file.."
    if it is empty then exit to top
    put textEncode(fld "nonlatin","utf8") into url ("file:" & it)
    put the result
end mouseUp

Reading in:

on mouseUp
    answer file "Open file.."
    if it is empty then exit to top
    put url ("file:" & it) into tText
    put textDecode(tText,"utf8") into fld "nonlatin"
    put the result
end mouseUp

You have to know the format of the file you're reading in, but it works well.

Devin


Devin Asay
Office of Digital Humanities
Brigham Young University





More information about the use-livecode mailing list