You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Marta Gascó Julio <mg...@care-t.com> on 2006/12/12 18:16:38 UTC
Qüestion about VelocityContext
I'm trying to change the encoding of VelocityContext. I would like to do something like that:
VelocityContext lNVContext = new VelocityContext();
lNVContext.CurrentResource.Encoding = "ISO-8859-1";
But while tracing, CurrentResource is always null. Do you know any way of changing the encoding before merge? I would like to use in my templates accents and "ñ" (letter used in spanish)
Thanks in advance for your help.
Marta Gascó Julio
Transformation Engines Coordinator
mgasco@care-t.com
CARE TECHNOLOGIES, S.A.
Tel. +34 96 643 5555 - Fax. +34 96 643 5554
www.olivanova.com
Grupo de Empresas CHG
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org
Re: Qüestion about VelocityContext
Posted by Will Glass-Husain <wg...@forio.com>.
There is no encoding property for the context.
You need to change the encoding for the output file.
If the source template itself has latin characters, you'll also want
to specify that encoding with getTemplate(resourceName, encoding).
WILL
On 12/12/06, Marta Gascó Julio <mg...@care-t.com> wrote:
>
> I'm trying to change the encoding of VelocityContext. I would like to do something like that:
>
> VelocityContext lNVContext = new VelocityContext();
> lNVContext.CurrentResource.Encoding = "ISO-8859-1";
>
> But while tracing, CurrentResource is always null. Do you know any way of changing the encoding before merge? I would like to use in my templates accents and "ñ" (letter used in spanish)
>
> Thanks in advance for your help.
>
> Marta Gascó Julio
> Transformation Engines Coordinator
> mgasco@care-t.com
>
> CARE TECHNOLOGIES, S.A.
> Tel. +34 96 643 5555 - Fax. +34 96 643 5554
> www.olivanova.com
> Grupo de Empresas CHG
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
> For additional commands, e-mail: dev-help@velocity.apache.org
>
>
--
Forio Business Simulations
Will Glass-Husain
wglass@forio.com
www.forio.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org