[copypaste from velocity-user mailing list]
Date: Mon, 14 Jul 2003 01:52:11 -0700 (PDT)
From: mailmur <firstname.lastname@example.org>
Subject: UnicodeFileResourceLoader to support Win2k Notepad UTF-8 files
Content-Type: text/plain; charset=us-ascii
I discovered, that files saved with Win2k Notepad UTF-8 format always generated
an extra ? character at the start of ISO-8859-1 output text.
This was due to lack of UTF8 BOM mark support in
I then created a inputstream implementation to skip BOM mark to overcome this
Please, find here a source + testprogram to see it for yourself. I created
UnicodeFileResourceLoader to make all this transparent.
I dont know what is the proper procedure to add this to Velocity core (if you
find this useful), but here it is. Feel free to change class package. Or is
this even the right list to announce such addition....
Here is a link to Sun bugparade about the UTF-8 BOM problem: