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

Simon Dorset simon at dorsetcomputing.co.uk
Tue Nov 20 05:27:11 EST 2018

There is definitely a hidden preference which controls this. I'm sorry that
I can't immediately recall what it is, but I did find it by searching on
this board.

-----Original Message-----
From: omnisdev-en <omnisdev-en-bounces at lists.omnis-dev.com> On Behalf Of jmv
Sent: 20 November 2018 10:04
To: Michael Matthews via omnisdev-en <omnisdev-en at lists.omnis-dev.com>
Subject: $Ov8.1.6-MacOS-10.13.6 :: Unicode UTF8 without BOM

Hi Listers,

I have to send a text file without BOM.

The text of this file is constructed in omnis with kCharacter/kSimplechar

As it is character data I use Do $writecharacter

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

When I open the file in BBEditv12.5 it indicates that it is format UTF8 with
If I try to export this file on my web site (I'm using One.com
<http://one.com/>) it does not open as One doesn't understand the BOM.

I understand that the BOM is not of much use with UTF8.

I tried to exclude it with :

vErrTxt) Returns vError ;; Get rid of : 0xEF,0xBB,0xBF

I again save it with $writecharacter. But in BBEdit it shows as UTF with

So ...

I try to remove it myself with :

	Calculate vBinTxt as pTexte Calculate vFirst_Byte as 12 ;; On ignore
0 .. 11 
	Calculate vLast_Byte as binlength(vBinTxt) 
	Do bytemid(vBinTxt,vFirst_Byte,vLast_Byte) Returns vBinCut

But vBinCut miss the first three letters : no spur of any 0xEF,0xBB,0xBF at
the beginning of the file.

IF in BBEdit I change the file to UTF8 without BOM, it charges well in
One.com <http://one.com/>.

1) Does $writecharacter add the BOM without my knowledge ?

2) Is there somewhere a boolean to set to stop $writecharacter do do this ?

3) Or is there another mean to produce a text file UTF8 without the BOM ?

Thank you for your times.

Best regards,

Jean-Marc Voegeli
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