Textpattern Forum

You are not logged in. Register | Login | Help

#11 2007-05-24 21:49:21

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,390
Website

Re: Byte-Order Mark

Sorry, I don’t quite get it. I didn’t have Notepad so I just installed it, but how do I save a file as ANSI? Do I choose Format and check Encode in ANSI? Do I also have to check UTF-8 without BOM?


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

#12 2007-05-24 21:55:48

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,390
Website

Re: Byte-Order Mark

Never mind, I did it (without checking UTF-8 without BOM) and the BOM is gone!

Thanks for your trouble Ruud! Just curious: how on earth do you find and see that BOM? I never saw anything…


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

#13 2007-05-24 21:58:09

ruud
Developer emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 4,538
Website

Re: Byte-Order Mark

In Dutch: kladblok (should be installed by default in Windows)
Yes, choose the format ‘Ansi’. If “UTF-8 without BOM” is also a option you can check, that would be even better, although for this file it probably won’t matter.

Offline

#14 2007-05-24 22:03:39

ruud
Developer emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 4,538
Website

Re: Byte-Order Mark

Using a hexdump utility, you can easily find these things.

For Linux users, run this in the directory that contains the files you want to check (it matches images as well, but this is mostly to quickly find candidates that have a BOM, although it doesn’t work on files/dirs with spaces (should’ve used xargs)):

for i in `find . -type f|grep -v .svn`; do od -x $i |grep 'bbef' > /dev/null && echo $i; done

I confirmed this by viewing the file with ‘less’ (it shows “<EF><BB><BF>” at the beginning of the file). It probably helps that I have my locale set to POSIX or some single-byte charset (haven’t switched to UTF-8 yet), otherwise i’d have to use ‘hexdump’ to confirm it (the hexdump would have shown: “bbef 3cbf” as the first hex chars).

Last edited by ruud (2007-05-24 22:13:47)

Offline

#15 2007-05-24 22:03:45

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,390
Website

Re: Byte-Order Mark

Kladblok??? I hate that ;) That doesn’t have all those options. What I just installed is Notepad++.

Edit: (crossposting all the time…)

ruud wrote:

For Linux users,

Ah, learned something again. I should spend more time with my Linux laptop in stead of this Windows thing… ;)

Thanks again!

Last edited by Els (2007-05-24 22:08:04)


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

#16 2007-11-12 08:47:08

net-carver
Admin
From: UK
Registered: 2006-03-08
Posts: 1,648

Re: Byte-Order Mark

ruud

thanks for tracking this one down in the MLP. Your script example will come in handy too for checking files before packaging up future builds.

Do you happen to know the unix command line way of truncating the BOM from such files?

Edit: Think I just worked out a way to do it using “dd ibs=1 skip=3”. Anyway, will play with that and see what happens.

Edit2: Yes, dd if=l10n_base.php of=new_l10n_base.php bs=1 skip=3 does the job just fine.

Last edited by net-carver (2007-11-12 09:01:27)


Steve
Textile | My plugins on GitHub | @netcarver

Offline

#17 2007-12-26 22:12:05

beatfreak
New Member
Registered: 2006-03-02
Posts: 8

Re: Byte-Order Mark

I have the Byte-Order Mark bug with the latest version of the pack (0.7.650).
I think the bug might be somewhere in the gbp_admin_library plugin.

When the gbp_admin_library plugin is inactive, I get an error-message at the first line of my document with the doctype on the second line.
When I activate the plugin, I get an empty line first before the doctype and my xhtml page renders invalid: Byte-Order Mark found …

Offline

#18 2007-12-26 23:55:12

Els
Admin
From: The Netherlands
Registered: 2004-06-06
Posts: 7,390
Website

Re: Byte-Order Mark

The BOM problem should have been fixed. So you’d better post this in the plugin thread.


<txp:Els /> ;)
Tag Reference | Unexpected behaviour? Check the tag trace | Still no clue? Check the names of your custom fields

Offline

#19 2007-12-27 00:19:05

net-carver
Admin
From: UK
Registered: 2006-03-08
Posts: 1,648

Re: Byte-Order Mark

beatfreak

thanks, I’ll look into it.


Steve
Textile | My plugins on GitHub | @netcarver

Offline

#20 2007-12-27 01:20:13

net-carver
Admin
From: UK
Registered: 2006-03-08
Posts: 1,648

Re: Byte-Order Mark

beatfreak

I’ve gone trough the source code and the files included in that version of the pack and I can’t detect any BOM there. There are some older versions of the plugin in the svn repository which do have a BOM in them — but they aren’t included in that build of the MLP Pack.

Are you using the latest gbp_admin_library?


Steve
Textile | My plugins on GitHub | @netcarver

Offline

Board footer

Powered by FluxBB