]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/UTF-8_BOM_showing_up_inside_a_page__63__.mdwn
scrubber needs updating
[ikiwiki.git] / doc / bugs / UTF-8_BOM_showing_up_inside_a_page__63__.mdwn
1 I have a git-backed ikiwiki install, and when I commit and push a file from an x86 host (LANG=en_US.UTF-8) to the Ikiwiki box, which is Debian GNU/Linux on Sparc, I sometimes get unusual characters (ef bb ff) before the first character of the wiki text.  It seems that this is a UTF-8 "byte order mark" that is getting inserted automatically into the .wiki file by my editor: http://vim.wikia.com/wiki/VimTip246#Tip:_.23246_-_Working_with_Unicode 
2
3 Example:
4
5         http://monkey.linuxworld.com/lwce-2007/
6
7 Is there any way for ikiwiki to spot when .wiki files have this BOM and
8 deal with it, or should I make sure to strip it out before committing?
9
10 > It would be easy to make ikiwiki strip out the BOM. For example, a simple
11 > plugin could be written to s/// them out as a filter.
12 >
13 > I'm unsure if ikiwiki should do this by default. --[[Joey]]
14
15 > Looked at this some more. It seems this would be a browser bug, after
16 > all, it's not displaying the BOM properly.
17 > To test, I've added a BOM to this file. 
18
19 > Well, this page looks ok in epiphany and w3m, even with the BOM. Epiphany
20 > incorrectly displays it as a space (not zero-width). In w3m in a unicode
21 > xterm, it's invisible. What's going on is that <FEFF> is only a BOM at
22 > the very beginning of the file. Otherwise, it should be treated as a
23 > zero-width, non-breaking space. Ie, invisible. Any browsers that display
24 > it otherwise seem to be broken. 
25
26 > I'm having a hard time with the idea that any program that reads utf-8
27 > data from a file and sticks it in the middle on another, output, utf-8
28 > file, is broken if it doesn't strip the BOM. It could be argued that
29 > programs should do that; it could be argued that perl should strip the
30 > BOM from the beginning of a file whenever reading a file in utf8 mode, to
31 > avoid all perl programs needing to do this on their own. Or it could be
32 > argued that requiring all programs do this is silly, and that the BOM was
33 > designed so you didn't need to strip it.
34
35 > After consideration, I prefer this last argument, so I prefer not to
36 > make ikiwiki stip utf8 BOMS. Calling this bug [[done]].
37
38 > --[[Joey]]