On 2015-08-25 11:10+0100 Phil Rosenberg wrote: > Hi Alan > It seems that this character is a BOM - > https://en.wikipedia.org/wiki/Byte_order_mark. I think it is there so > that if a system with different endianness tries to read the file it > will see that character as FFFE instead of FEFF and knows to swap the > byte order. However given that the file was (auto detected to be?) > UTF8, I'm not sure why this was added. UTF8 has a different BOM which > isn't really needed. > > There is a setting to turn the BOM off on my editor so I have done so > and resaved the file. In git status -v I could see that the first line > had changed, however the new and old lines looked Identical. I guess > this is because my console is rendering the BOM as a utf16 character - > it's representation being a zero width nonbreaking space. > > If you could confirm it is gone then that would be great.
Hi Phil (and others here who use Windows editors): Now that you have identified that character as a BOM added by your windows editor, I looked that up with google, and it appears that is a character that is allowed but definitely not required by the UTF-8 standard. Since not all software recognizes such BOM characters for best results it is good to remove BOM characters from UTF-8 files. Also, from google searching I found a method (using the file command on POSIX systems) to detect whether your editor had added a BOM to any other file in our source tree: Here is the overall check for that before fetching your change: software@raven> pwd /home/software/plplot/HEAD/plplot.git software@raven> (find . -type f |grep -v .git |xargs file) |grep BOM ./doc/docbook/src/api.xml: HTML document, UTF-8 Unicode (with BOM) text So that file was the only one in our source tree that contained a BOM, and after fetching your change here are the git diff results: software@raven> git diff 246eea0..68c0256 diff --git a/doc/docbook/src/api.xml b/doc/docbook/src/api.xml index 706aece..f31a0cc 100644 --- a/doc/docbook/src/api.xml +++ b/doc/docbook/src/api.xml @@ -1,4 +1,4 @@ -<U+FEFF><!-- -*- mode: nxml -*- --> +<!-- -*- mode: nxml -*- --> <!-- api.xml: "The Common API for PLplot" chapter which confirms your commit removed that BOM. I also retried the above find command, and this time it reported (as expected) no BOM results. Therefore, we now have a BOM-free source tree again. Thanks for this cleanup! Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------------ _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel