Encoding cvs file with UTF8 with BOM

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
JackBroughton
Posts: 9
Joined: Tue Oct 21, 2014 2:18 am

Encoding cvs file with UTF8 with BOM

Post by JackBroughton » Wed Dec 17, 2014 4:07 am

Hi All,

I have been asked to export some data from my system into a cvs file with UTF8 w BOM Encodeing.

I have read a stack on uniencode and have I currently have it exporting with UTF8 but it does not have the BOM encoding.

Can anyone help me with this issue?

Thanks, Jack

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Encoding cvs file with UTF8 with BOM

Post by MaxV » Fri Dec 19, 2014 4:53 pm

BOM for UTF-8 are three byte: EF BB BF

EE = 238
BB = 187
BF = 191

so just:

Code: Select all

put numtoByte(238) & numtoByte(187) & numtoByte(191) before myText 
put mytext into URL "binfile:./mytext.txt"
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply