On the text output method Saxon currently writes a byte order mark only for encoding="utf-8". For the XML output method it will also write one (if requested) for utf-16le and utf-16be, and I think you are right that the text output method should be brought into line.
 
Michael Kay
http://www.saxonica.com/

From: Stanislav Okhvat [mailto:stasokhvat@gmail.com]
Sent: 18 April 2009 17:58
To: saxon-help@lists.sourceforge.net
Subject: [saxon] Adding byte order mark to text files

Hi,

I am trying to use the Saxon Extensions feature to output a byte order mark in text files generated with Saxon (9.1.0.6J). The encoding is UTF-16LE since I need the file as input to a program which can only understand Windows Notepad-type Unicode files (byte order mark FF+FE). This is the header of my XSLT stylesheet:

<xsl:stylesheet version="1.0" xmlns:saxon="http://saxon.sf.net/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="UTF-16LE" saxon:byte-order-mark="yes"/>

However, no byte order mark is inserted in the file. Any ideas?

Thanks a lot!

Stas