Saving Russian text to a file?

Devin Asay devin_asay at byu.edu
Tue Sep 29 12:39:18 EDT 2015


> On Sep 27, 2015, at 7:31 PM, Bruce Pokras <dangmacguy at gmail.com> wrote:
> 
> I have a desktop app for Mac OS X and Windows that will display Russian text in a field without any problem. However, I have a user in Russia who would like to be able to save that text to a file. My attempts have mainly resulted in question marks where the Cyrillic characters are supposed to be. Is there a particular way in which I should be saving the text to file?
> 

Chiming in late here. The short answer is “yes, you can.” 

But the “how” depends on what version of LC your application was built in, and what format you want the file to be save in (UTF-8, UTF-16, RTF, HTML).

If you are in LC 7 or above, you simple textEncode your text as you save it. Eg.:

put textEncode(field "output","UTF-8") into tOutput
put tOutput into url ("file:output.txt”)

If you are in LC v. < 7 you do something similar, but use uniDecode function instead:

put the unicodeText of fld “myUniText” into tOutput
put uniDecode(tOutPut,"utf8") into url "binfile:/path/to/file/myUniFile.ut8"

Or, as Richmond suggested, you can also save the htmlText or rtfText of the field in question.

HTH

Devin


Devin Asay
Office of Digital Humanities
Brigham Young University



More information about the use-livecode mailing list