You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Henning Schmiedehausen (JIRA)" <de...@velocity.apache.org> on 2007/01/24 16:30:49 UTC

[jira] Resolved: (VELOCITY-191) UnicodeFileResourceLoader for Win2k Notepad UTF-8 files

     [ https://issues.apache.org/jira/browse/VELOCITY-191?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henning Schmiedehausen resolved VELOCITY-191.
---------------------------------------------

    Resolution: Fixed

This is the last and final patch that goes into 1.5 :-)

However, by studying this further, that is a kludge at best. I mainly put it in to help users that run into that problem.

The BOM encoding is not actually used anywhere, the stream is mainly used to skip over the BOM so that it does not show up in the templates. However, if we had a way to pass the encoding "up" into the engine (which would mainly mean that the resource loaders don't pass an InputStream but an InputReader in), we could "autodetect" the file encodings.

Velocity 2.0 stuff, I'm afraid...

> UnicodeFileResourceLoader for Win2k Notepad UTF-8 files
> -------------------------------------------------------
>
>                 Key: VELOCITY-191
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-191
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: 1.3.1
>         Environment: Operating System: All
> Platform: All
>            Reporter: Mailmur
>         Assigned To: Henning Schmiedehausen
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: FileResourceLoader-UnicodeStream.zip
>
>
> [copypaste from velocity-user mailing list]
> Date: Mon, 14 Jul 2003 01:52:11 -0700 (PDT)
> From: mailmur <ma...@yahoo.com>
> 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 
> InputStreamReader/OutputStreamWriter classes.
> I then created a inputstream implementation to skip BOM mark to overcome this 
> bug.
> Please, find here a source + testprogram to see it for yourself. I created 
> UnicodeFileResourceLoader to make all this transparent.
> http://koti.mbnet.fi/akini/java/unicodereader/
> 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: 
> http://developer.java.sun.com/developer/bugParade/bugs/4508058.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org