Zen Cart Logo
Forums / General Questions / UTF-8 without BOM 2022

UTF-8 without BOM 2022

Views: 2,030

Results 1 to 8 of 8
23 Oct 2022, 5:32 AM
#1
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

UTF-8 without BOM 2022

Is coding in zen cart still to be done in UTF-8 without BOM, or is plain UTF-8 now OK?

In older versions of Notepad++ there used to be an encoding option of "UTF-8 without BOM". Now the only options are UTF-8 and UTF-8-BOM, where it is not clear to me whether UTF-8-BOM actually means UTF-8 minus or without BOM or something else.

While I have yet to figure out how to test for BOM, my research into the matter has not yielded unequivocal results, with the online npp user manual and online forum being quite useless. :(

So here I ask whether UTF-8-BOM in Notepadd++ is their way of writing "UTF-8 without BOM" or what?

Thanks in advance.

23 Oct 2022, 7:33 AM
#2
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,872
Plugin Contributions:
7

Re: UTF-8 without BOM 2022

I think utf-8 is without BOM, utf-8 BOM is with BOM:
Attachment 20127
sorry I don't know how to get this image any better but it is just readable.

23 Oct 2022, 10:04 AM
#3
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Location:
Croatia
Posts:
1,788
Plugin Contributions:
21

Re: UTF-8 without BOM 2022

I'll agree with torvista.

Besides, using your "UTF-8-BOM actually means UTF-8 minus or without BOM" logic, why are you being selective about the hyphen - why not read it as "UTF without 8 without BOM"? :wink2:
UFT8 and UTF-8 are the same thing, so UTF-8-BOM should be UTF8BOM, it's just easier to read with the hyphen.

Just my 2c...

23 Oct 2022, 11:05 AM
#4
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,085
Plugin Contributions:
56

Re: UTF-8 without BOM 2022

As torvista and balihr indicated, when using Notepad++ the ***Encoding ***tab should be set to UTF-8 when writing any sort of PHP code (whether Zen Cart or other).

That's UTF-8 without BOM (byte-order mark), while Notepad++'s UTF-8 BOM includes the BOM.

24 Oct 2022, 1:21 AM
#5
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

Re: UTF-8 without BOM 2022

torvista:

I think utf-8 is without BOM, utf-8 BOM is with BOM:
Attachment 20127
sorry I don't know how to get this image any better but it is just readable.

Thanks Steve

For future reference I would really appreciate if you could tell how you actually generated that image:

2022-10-23 09_31_24-new 1 utf-8.txt _--_ new 1 utf-8 bom.txt - Hex Compare - Beyond Compare.jpg

I gather from the image title that you did a screen dump of a hex compare using Beyond Compare software, however I do not possess that software and the nearest software I have ATM is an embarrassingly old version of WinMerge. While I have yet to discern whether my WinMerge version has a hex compare function. I expect to upgrade my WinMerge to the 2022 version within a week or so.

Do the letters printed in red actually represent the letters BOM, which to my eyes they do not, or is that byte order mark coding generated by the encoding?

Did you type in any gobbledegook to do the compare and did you compare actual code?

Best Regards

24 Oct 2022, 8:35 AM
#6
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,085
Plugin Contributions:
56

Re: UTF-8 without BOM 2022

@dw08gm, you could try EditPad Lite (https://www.editpadlite.com/), its a free download and has a mode (I'm pretty sure, I've got the Pro version) that will display a file in 'hexadecimal' mode, too.

24 Oct 2022, 9:22 AM
#7
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,872
Plugin Contributions:
7

Re: UTF-8 without BOM 2022

how you actually generated that image:

I saved the same file of gibberish in the two formats and used Beyond Compare.
Text compare said they were the same, HEX compare showed the difference, which is only the initial characters in red, which I assume is the BOM.
Then did a screen capture with Greenshot.

I find Beyond Compare indispensable and well worth the cost.

25 Oct 2022, 2:41 AM
#8
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

Re: UTF-8 without BOM 2022

Thanks everyone for your input.

As a final note I add this self-explanatory link:

<https://en.wikipedia.org/wiki/Comparison_of_file_comparison_tools>

The two major tools WinMerge and Beyond Compare have both been updated in 2022, having survived the vicissitudes of Covid-19 (at least for now).

Cheers