R: $Ov8.1.6-MacOS-10.13.6 :: Unicode UTF8 without BOM

Alessandro Pigozzo alessandro.pigozzo at prosyt.it
Tue Nov 20 08:22:47 EST 2018

Try using "Set print or export file name" and "Transmit text to print file" commands.
Set $root.$prefs.$exportencoding to kUniTypeUTF8.
With $root.$prefs.$exportbom=kTrue, BOM is added at the top.
With $root.$prefs.$exportbom=kFalse, BOM is NOT added.

Alessandro Pigozzo 

-----Messaggio originale-----
Da: omnisdev-en [mailto:omnisdev-en-bounces at lists.omnis-dev.com] Per conto di Kelly Burgess
Inviato: martedì 20 novembre 2018 13.52
A: OmnisList
Oggetto: Re: $Ov8.1.6-MacOS-10.13.6 :: Unicode UTF8 without BOM

Hi Jean-Marc,

 >Do vFileObj.$writecharacter(kUniTypeUTF8,pTexte,kFalse) Returns vOK
> .. it is format UTF8 with BOM.

Yes, I see that, and it doesn't matter if $root.$prefs.$exportbom is kTrue or kFalse.  I get a 3-byte BOM at the top of the file.

I can avoid the BOM two ways: 

  Do vFileObj.$writecharacter(kUniTypeNativeCharacters,pTexte,kFalse) Returns vOK


  Do vFileObj.$writefile(chartoutf8(pTexte) Returns vOK

But I don't know if kUniTypeNativeCharacters is high-ascii-friendly or not, and I don't know if 2-byte utf8 values will be treated properly in files without BOMs.

Manage your list subscriptions at http://lists.omnis-dev.com Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com 

More information about the omnisdev-en mailing list