Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.3.1
-
None
-
Operating System: other
Platform: Other
-
28377
Description
The encoding of template files is well-defined, so I see no reason to deprecate
the method from above.
There is a velocity property input.encoding which defines the encoding
of templates
"Character encoding for input (templates). Using this, you can use alternative
encoding for your templates, such as UTF-8."
I feel that Velocity.mergeTemplate(String,Context,Writer) should simply use
that encoding.
By deprecating the method and referencing to mergeTemplate
(String,String,Context,Writer) you force a developer to duplicate the property.
Suggestion:
IF you decide to keep it deprecated, please extend the javadoc of the long
mergeTemplate method eg:
"
The default encoding that Velocity uses to read template files is defined in
the property input.encoding and defaults to ISO-8859-1.
You can get the encoding that is currently configured in the Velocity runtime
using
"RuntimeSingleton.getString
(RuntimeConstants.INPUT_ENCODING,RuntimeConstants.ENCODING_DEFAULT)"
And you can paste that code for the second parameter of mergeTemplate.
"