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

Doug Easterbrook doug at artsman.com
Tue Nov 20 20:22:25 EST 2018


hi Bas.

$root.$prefs.$exportBOM   — we have it set to false and as far as I know, that prevents the bom marker going on an export file..

at least thats what the documentation says.     but then we’ve never had a complaint from people .


so I did a test
— export a file with a unicode character in it with $root.$prefs.$exportBOM=false
— the export file had the right unicode char according to bbedit
— and looking at the file with hexedit said there was no bom marker.

Doug Easterbrook
Arts Management Systems Ltd.
mailto:doug at artsman.com
http://www.artsman.com
Phone (403) 650-1978

> On Nov 20, 2018, at 2:44 PM, Bastiaan Olij <Bastiaan.Olij at instinctsystems.com.au> wrote:
> 
> Hi Kelly and Jean-Marc,
> 
> 
> I don't think kUnitTypeNativeCharacters exports UTF8. It exports in ASCII native to the platform, so likely CP1252 on Windows and MacRoman on Mac. BBEdit wouldn't be able to tell because the first 128 characters aren't any different between all the character sets. Things go wrong once you have any of the higher characters in your data set. It will likely fail to import then.
> 
> 
> I don't know why Omnis adds the BOM in when not required, it hasn't for me but I haven't used that way of writing data for awhile. I always go the chartoutf8(variable) path myself.
> 
> Kindest Regards,
> 
> 
> Bastiaan Olij
> Head of development - Instinct Systems: The JobBag People
> Ground Floor, 48 Chandos Street
> St Leonards NSW 2065
> Australia
> 
> 
> Phone +61 2 8115 8000
> Mobile +61 4 321 44833
> bastiaan.olij at instinctsystems.com.au
> http://www.jobbag.com
> 
> 
> 
> From:   jmv <jmvoegeli at bluewin.ch> 
> To:   OmnisDev List - English <omnisdev-en at lists.omnis-dev.com> 
> Sent:   11/21/2018 1:10 AM 
> Subject:   Re: $Ov8.1.6-MacOS-10.13.6 :: Unicode UTF8 without BOM 
> 
> Hi Kelly,
> 
> Thank You very much. You were very useful as always.
> 
> I have done your code :
> 
>          Do vFileObj.$writecharacter(kUniTypeNativeCharacters,pTexte,kFalse) Returns vOK
> 
> Everything was perfect. When opened in BBEdit, it says "UTF8", no more "BOM"
> 
>> Le 20 nov. 2018 à 13:52, Kelly Burgess <kellyb at montana.com> a écrit :
>> 
>> 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.
> 
> I suppose you mean diacritics. I build the following files without any errors :
> 
> <?php
> function VerifBordif ($pCode) {
>     $vTabloDesBordifs[0] = "ZBARCLAU-590330-103";
>     $vTabloDesNiveaux[0] = 4;
>    $vLen = 1;
>    $vN = 0;
>    for ($vI = 0; $vI < $vLen; $vI += 1)
>    {
>        If ($pCode == $vTabloDesBordifs[$vI])
>        {
>            $vN = $vTabloDesNiveaux[$vI];
>            break;
>        }
>    }
> return $vN;
> } // VerifBordif
> ?>
> àéèêâîàñ
> 
> I have added garbage at the end and it was written as such !
> 
> The file was recognize as UTF8 OK.
> 
> I don't know if that answer your remark.
> 
> Thanks again Kelly.
> 
> My very 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 
> _____________________________________________________________
> 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