You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by srht <se...@gmail.com> on 2007/08/27 11:25:25 UTC

turkish encoding problem

hi
i use velocity engine with rtf template in my java application.
but it cant write  turkish characters truly in rtf file. i try set velocity
engine encoding below. 
		Properties p = new Properties();
		
		  p.setProperty( VelocityEngine.INPUT_ENCODING, "Windows-1254");
		  p.setProperty( VelocityEngine.OUTPUT_ENCODING, "Windows-1254");
		  p.setProperty(VelocityEngine.ENCODING_DEFAULT, "Windows-1254");
  and 
		  p.setProperty( VelocityEngine.INPUT_ENCODING, "ISO-8859-9");
		  p.setProperty( VelocityEngine.OUTPUT_ENCODING, "ISO-8859-9");
		  p.setProperty(VelocityEngine.ENCODING_DEFAULT, "ISO-8859-9");
	         velocityEngine.init(p);

but it cant work. what else can i do?
thnks for help...


-- 
View this message in context: http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a12343968
Sent from the Velocity - User mailing list archive at Nabble.com.


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


RE: VelocityViewServlet 1.1 to 1.3 upgrade causing big slowdown

Posted by Steve O'Hara <so...@pivotal-solutions.co.uk>.
I think it is something to do with IDEA, because when I run it outside
of the debugger, it runs fine both in cached mode and non-cached mode.
The same when I run with the profiler attached.

Thanks,

Steve



-----Original Message-----
From:
user-return-19298-sohara=pivotal-solutions.co.uk@velocity.apache.org
[mailto:user-return-19298-sohara=pivotal-solutions.co.uk@velocity.apache
.org] On Behalf Of apache@recks.org
Sent: 12 September 2007 16:42
To: Velocity Users List
Subject: Re: VelocityViewServlet 1.1 to 1.3 upgrade causing big slowdown

Just an Idea...
maybe the reason for the slowdown is that before you where using the
pre-initialized singleton, and after the upgrade you are instantiating
an engine every time?

:) Christoph

Steve O'Hara wrote:
> In attempting to implement dynamic configuration updates, I had to
> upgrade to VelocityTools 1.3 so that I use the VelocityEngine rather
> than the Velocity singleton.
> 
> However, I notice a huge slow down on getting and merging a template.
> This is particularly apparent when doing this on an "empty" context
> template - so that the template writer can embed some initial values
for
> the application, we merge the template to an empty string, then read
the
> initial values from the context.  This process is now taking a second
or
> two where before it was pretty nigh on instant.  I haven't changed the
> application other than to reference the new engine via
> getVelocityEngine().
> 
> Here are my properties:-
> 
>             objProps.setProperty("resource.loader", "Scaffold");
>             objProps.setProperty("Scaffold.resource.loader.class",
"com.pivotal.scaffold.ScaffoldResourceLoader");
>  
> objProps.setProperty("Scaffold.resource.loader.templatepath", sPath +
"/WEB-INF/templates");
>
objProps.setProperty("Scaffold.resource.loader.reportpath", sPath +
"/WEB-INF/report");
>
objProps.setProperty("Scaffold.resource.loader.testreportpath", sPath +
"/WEB-INF/report/test");
>
objProps.setProperty("Scaffold.resource.loader.macrospath", sPath +
"/WEB-INF/macros");
>
objProps.setProperty("Scaffold.resource.loader.modificationCheckInterval
", "10");
>             objProps.setProperty("runtime.log.logsystem.class",
"org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
>
objProps.setProperty("runtime.log.logsystem.log4j.category",
"org.apache.velocity");
>             objProps.setProperty("velocimacro.library",
"macros/general.inc,macros/admin.inc,macros/main.inc");
>
objProps.setProperty("velocimacro.permissions.allow.inline", "true");
>
objProps.setProperty("velocimacro.permissions.allow.inline.local.scope",
"true");
>             objProps.setProperty("velocimacro.context.localscope",
"false");
> 
> I know I haven't provided a great deal to go on but apart from upgrade
I
> haven't changed anything - any ideas?
> 
> Steve
> 
> 
> 
> -----Original Message-----
> From:
> user-return-19294-sohara=pivotal-solutions.co.uk@velocity.apache.org
>
[mailto:user-return-19294-sohara=pivotal-solutions.co.uk@velocity.apache
> .org] On Behalf Of mailmur
> Sent: 11 September 2007 17:34
> To: Velocity Users List
> Subject: Re: turkish encoding problem
> 
> Somehow I tend to believe character encoding is
> already broken before strings are even put into a
> velocity context. 
> 
> Or is it that turkish chars are in a source template
> file, they are not passed as a context variables?
> 
> What if you could use UnicodeFileResourceLoader, save
> file as UTF-8withBOM marker. Use Windows
> Notepad.exe/File/Save as... to do it.
> 
> Create a simple standalone test program, put some
> turkish characters to a source template, add more
> chars to a context variables, run template and save
> output.
> 
> Upload a simple test program somwhere available. Its
> sometimes hard to say anything concrete by reading a
> brief newsgroup post.
> 
> --- srht <se...@gmail.com> wrote:
> 
>> hi Will;
>> did u look something about the problems. it s
>> important for our project.
>> thnks much ...
>>
>>
>> srht wrote:
>>> yes i use it when merging template. and it s not a
>> singleton
>>> thnks for reply ...
>>>
>>>
>>>
>>> Will Glass-Husain-2 wrote:
>>>> That seems about right to me.  Are you calling
>> velocityEngine when
>>>> merging
>>>> the template (be sure you don't call the
>> singleton Velocity).
>>>> WILL
>>>>
>>>> On 8/27/07, srht <se...@gmail.com> wrote:
>>>>>
>>>>> hi
>>>>> i use velocity engine with rtf template in my
>> java application.
>>>>> but it cant write  turkish characters truly in
>> rtf file. i try set
>>>>> velocity
>>>>> engine encoding below.
>>>>>                 Properties p = new Properties();
>>>>>
>>>>>                   p.setProperty(
>> VelocityEngine.INPUT_ENCODING,
>>>>> "Windows-1254");
>>>>>                   p.setProperty(
>> VelocityEngine.OUTPUT_ENCODING,
>>>>> "Windows-1254");
>>>>>                  
>> p.setProperty(VelocityEngine.ENCODING_DEFAULT,
>>>>> "Windows-1254");
>>>>>   and
>>>>>                   p.setProperty(
>> VelocityEngine.INPUT_ENCODING,
>>>>> "ISO-8859-9");
>>>>>                   p.setProperty(
>> VelocityEngine.OUTPUT_ENCODING,
>>>>> "ISO-8859-9");
>>>>>                  
>> p.setProperty(VelocityEngine.ENCODING_DEFAULT,
>>>>> "ISO-8859-9");
>>>>>                  velocityEngine.init(p);
>>>>>
>>>>> but it cant work. what else can i do?
>>>>> thnks for help...
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>>
>
http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a12343968
>>>> -- 
>>>> Forio Business Simulations
>>>>
>>>> Will Glass-Husain
>>>> wglass@forio.com
>>>> www.forio.com
>> -- 
>> View this message in context:
>>
>
http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a12590416
>> Sent from the Velocity - User mailing list archive
>> at Nabble.com.
> 
> 
> 
>  
>
________________________________________________________________________
> ____________
> Tonight's top picks. What will you watch tonight? Preview the hottest
> shows on Yahoo! TV.
> http://tv.yahoo.com/ 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
> 
> 

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




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


Re: VelocityViewServlet 1.1 to 1.3 upgrade causing big slowdown

Posted by ap...@recks.org.
Just an Idea...
maybe the reason for the slowdown is that before you where using the pre-initialized singleton, and after the upgrade you are instantiating an engine every time?

:) Christoph

Steve O'Hara wrote:
> In attempting to implement dynamic configuration updates, I had to
> upgrade to VelocityTools 1.3 so that I use the VelocityEngine rather
> than the Velocity singleton.
> 
> However, I notice a huge slow down on getting and merging a template.
> This is particularly apparent when doing this on an "empty" context
> template - so that the template writer can embed some initial values for
> the application, we merge the template to an empty string, then read the
> initial values from the context.  This process is now taking a second or
> two where before it was pretty nigh on instant.  I haven't changed the
> application other than to reference the new engine via
> getVelocityEngine().
> 
> Here are my properties:-
> 
>             objProps.setProperty("resource.loader", "Scaffold");
>             objProps.setProperty("Scaffold.resource.loader.class", "com.pivotal.scaffold.ScaffoldResourceLoader");
>  
> objProps.setProperty("Scaffold.resource.loader.templatepath", sPath + "/WEB-INF/templates");
>             objProps.setProperty("Scaffold.resource.loader.reportpath", sPath + "/WEB-INF/report");
>             objProps.setProperty("Scaffold.resource.loader.testreportpath", sPath + "/WEB-INF/report/test");
>             objProps.setProperty("Scaffold.resource.loader.macrospath", sPath + "/WEB-INF/macros");
>             objProps.setProperty("Scaffold.resource.loader.modificationCheckInterval", "10");
>             objProps.setProperty("runtime.log.logsystem.class", "org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
>             objProps.setProperty("runtime.log.logsystem.log4j.category", "org.apache.velocity");
>             objProps.setProperty("velocimacro.library", "macros/general.inc,macros/admin.inc,macros/main.inc");
>             objProps.setProperty("velocimacro.permissions.allow.inline", "true");
>             objProps.setProperty("velocimacro.permissions.allow.inline.local.scope", "true");
>             objProps.setProperty("velocimacro.context.localscope", "false");
> 
> I know I haven't provided a great deal to go on but apart from upgrade I
> haven't changed anything - any ideas?
> 
> Steve
> 
> 
> 
> -----Original Message-----
> From:
> user-return-19294-sohara=pivotal-solutions.co.uk@velocity.apache.org
> [mailto:user-return-19294-sohara=pivotal-solutions.co.uk@velocity.apache
> .org] On Behalf Of mailmur
> Sent: 11 September 2007 17:34
> To: Velocity Users List
> Subject: Re: turkish encoding problem
> 
> Somehow I tend to believe character encoding is
> already broken before strings are even put into a
> velocity context. 
> 
> Or is it that turkish chars are in a source template
> file, they are not passed as a context variables?
> 
> What if you could use UnicodeFileResourceLoader, save
> file as UTF-8withBOM marker. Use Windows
> Notepad.exe/File/Save as... to do it.
> 
> Create a simple standalone test program, put some
> turkish characters to a source template, add more
> chars to a context variables, run template and save
> output.
> 
> Upload a simple test program somwhere available. Its
> sometimes hard to say anything concrete by reading a
> brief newsgroup post.
> 
> --- srht <se...@gmail.com> wrote:
> 
>> hi Will;
>> did u look something about the problems. it s
>> important for our project.
>> thnks much ...
>>
>>
>> srht wrote:
>>> yes i use it when merging template. and it s not a
>> singleton
>>> thnks for reply ...
>>>
>>>
>>>
>>> Will Glass-Husain-2 wrote:
>>>> That seems about right to me.  Are you calling
>> velocityEngine when
>>>> merging
>>>> the template (be sure you don't call the
>> singleton Velocity).
>>>> WILL
>>>>
>>>> On 8/27/07, srht <se...@gmail.com> wrote:
>>>>>
>>>>> hi
>>>>> i use velocity engine with rtf template in my
>> java application.
>>>>> but it cant write  turkish characters truly in
>> rtf file. i try set
>>>>> velocity
>>>>> engine encoding below.
>>>>>                 Properties p = new Properties();
>>>>>
>>>>>                   p.setProperty(
>> VelocityEngine.INPUT_ENCODING,
>>>>> "Windows-1254");
>>>>>                   p.setProperty(
>> VelocityEngine.OUTPUT_ENCODING,
>>>>> "Windows-1254");
>>>>>                  
>> p.setProperty(VelocityEngine.ENCODING_DEFAULT,
>>>>> "Windows-1254");
>>>>>   and
>>>>>                   p.setProperty(
>> VelocityEngine.INPUT_ENCODING,
>>>>> "ISO-8859-9");
>>>>>                   p.setProperty(
>> VelocityEngine.OUTPUT_ENCODING,
>>>>> "ISO-8859-9");
>>>>>                  
>> p.setProperty(VelocityEngine.ENCODING_DEFAULT,
>>>>> "ISO-8859-9");
>>>>>                  velocityEngine.init(p);
>>>>>
>>>>> but it cant work. what else can i do?
>>>>> thnks for help...
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>>
> http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a12343968
>>>> -- 
>>>> Forio Business Simulations
>>>>
>>>> Will Glass-Husain
>>>> wglass@forio.com
>>>> www.forio.com
>> -- 
>> View this message in context:
>>
> http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a12590416
>> Sent from the Velocity - User mailing list archive
>> at Nabble.com.
> 
> 
> 
>  
> ________________________________________________________________________
> ____________
> Tonight's top picks. What will you watch tonight? Preview the hottest
> shows on Yahoo! TV.
> http://tv.yahoo.com/ 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
> 
> 

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


Re: VelocityViewServlet 1.1 to 1.3 upgrade causing big slowdown

Posted by Nathan Bubna <nb...@gmail.com>.
That's odd.  I don't believe there were any changes that would have
jumped the time from "pretty nigh on instant" to "a second or two".
Here's one clarifying question...  is it this slow on every request or
just on the first one?   Really though, there's not much we can do to
help without knowing a lot more about the modifications you've made
and how your application works.  Do you have a profiler set up so you
can find out where the bottleneck is happening?

On 9/11/07, Steve O'Hara <so...@pivotal-solutions.co.uk> wrote:
> In attempting to implement dynamic configuration updates, I had to
> upgrade to VelocityTools 1.3 so that I use the VelocityEngine rather
> than the Velocity singleton.
>
> However, I notice a huge slow down on getting and merging a template.
> This is particularly apparent when doing this on an "empty" context
> template - so that the template writer can embed some initial values for
> the application, we merge the template to an empty string, then read the
> initial values from the context.  This process is now taking a second or
> two where before it was pretty nigh on instant.  I haven't changed the
> application other than to reference the new engine via
> getVelocityEngine().
>
> Here are my properties:-
>
>             objProps.setProperty("resource.loader", "Scaffold");
>             objProps.setProperty("Scaffold.resource.loader.class",
> "com.pivotal.scaffold.ScaffoldResourceLoader");
>
> objProps.setProperty("Scaffold.resource.loader.templatepath", sPath +
> "/WEB-INF/templates");
>             objProps.setProperty("Scaffold.resource.loader.reportpath",
> sPath + "/WEB-INF/report");
>
> objProps.setProperty("Scaffold.resource.loader.testreportpath", sPath +
> "/WEB-INF/report/test");
>             objProps.setProperty("Scaffold.resource.loader.macrospath",
> sPath + "/WEB-INF/macros");
>
> objProps.setProperty("Scaffold.resource.loader.modificationCheckInterval
> ", "10");
>             objProps.setProperty("runtime.log.logsystem.class",
> "org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
>             objProps.setProperty("runtime.log.logsystem.log4j.category",
> "org.apache.velocity");
>             objProps.setProperty("velocimacro.library",
> "macros/general.inc,macros/admin.inc,macros/main.inc");
>             objProps.setProperty("velocimacro.permissions.allow.inline",
> "true");
>
> objProps.setProperty("velocimacro.permissions.allow.inline.local.scope",
> "true");
>             objProps.setProperty("velocimacro.context.localscope",
> "false");
>
> I know I haven't provided a great deal to go on but apart from upgrade I
> haven't changed anything - any ideas?
>
> Steve
>
>
>
> -----Original Message-----
> From:
> user-return-19294-sohara=pivotal-solutions.co.uk@velocity.apache.org
> [mailto:user-return-19294-sohara=pivotal-solutions.co.uk@velocity.apache
> .org] On Behalf Of mailmur
> Sent: 11 September 2007 17:34
> To: Velocity Users List
> Subject: Re: turkish encoding problem
>
> Somehow I tend to believe character encoding is
> already broken before strings are even put into a
> velocity context.
>
> Or is it that turkish chars are in a source template
> file, they are not passed as a context variables?
>
> What if you could use UnicodeFileResourceLoader, save
> file as UTF-8withBOM marker. Use Windows
> Notepad.exe/File/Save as... to do it.
>
> Create a simple standalone test program, put some
> turkish characters to a source template, add more
> chars to a context variables, run template and save
> output.
>
> Upload a simple test program somwhere available. Its
> sometimes hard to say anything concrete by reading a
> brief newsgroup post.
>
> --- srht <se...@gmail.com> wrote:
>
> >
> > hi Will;
> > did u look something about the problems. it s
> > important for our project.
> > thnks much ...
> >
> >
> > srht wrote:
> > >
> > > yes i use it when merging template. and it s not a
> > singleton
> > >
> > > thnks for reply ...
> > >
> > >
> > >
> > > Will Glass-Husain-2 wrote:
> > >>
> > >> That seems about right to me.  Are you calling
> > velocityEngine when
> > >> merging
> > >> the template (be sure you don't call the
> > singleton Velocity).
> > >>
> > >> WILL
> > >>
> > >> On 8/27/07, srht <se...@gmail.com> wrote:
> > >>>
> > >>>
> > >>> hi
> > >>> i use velocity engine with rtf template in my
> > java application.
> > >>> but it cant write  turkish characters truly in
> > rtf file. i try set
> > >>> velocity
> > >>> engine encoding below.
> > >>>                 Properties p = new Properties();
> > >>>
> > >>>                   p.setProperty(
> > VelocityEngine.INPUT_ENCODING,
> > >>> "Windows-1254");
> > >>>                   p.setProperty(
> > VelocityEngine.OUTPUT_ENCODING,
> > >>> "Windows-1254");
> > >>>
> > p.setProperty(VelocityEngine.ENCODING_DEFAULT,
> > >>> "Windows-1254");
> > >>>   and
> > >>>                   p.setProperty(
> > VelocityEngine.INPUT_ENCODING,
> > >>> "ISO-8859-9");
> > >>>                   p.setProperty(
> > VelocityEngine.OUTPUT_ENCODING,
> > >>> "ISO-8859-9");
> > >>>
> > p.setProperty(VelocityEngine.ENCODING_DEFAULT,
> > >>> "ISO-8859-9");
> > >>>                  velocityEngine.init(p);
> > >>>
> > >>> but it cant work. what else can i do?
> > >>> thnks for help...
> > >>>
> > >>>
> > >>> --
> > >>> View this message in context:
> > >>>
> >
> http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a12343968
> > >>
> > >> --
> > >> Forio Business Simulations
> > >>
> > >> Will Glass-Husain
> > >> wglass@forio.com
> > >> www.forio.com
> >
> > --
> > View this message in context:
> >
> http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a12590416
> > Sent from the Velocity - User mailing list archive
> > at Nabble.com.
>
>
>
>
> ________________________________________________________________________
> ____________
> Tonight's top picks. What will you watch tonight? Preview the hottest
> shows on Yahoo! TV.
> http://tv.yahoo.com/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>

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


VelocityViewServlet 1.1 to 1.3 upgrade causing big slowdown

Posted by Steve O'Hara <so...@pivotal-solutions.co.uk>.
In attempting to implement dynamic configuration updates, I had to
upgrade to VelocityTools 1.3 so that I use the VelocityEngine rather
than the Velocity singleton.

However, I notice a huge slow down on getting and merging a template.
This is particularly apparent when doing this on an "empty" context
template - so that the template writer can embed some initial values for
the application, we merge the template to an empty string, then read the
initial values from the context.  This process is now taking a second or
two where before it was pretty nigh on instant.  I haven't changed the
application other than to reference the new engine via
getVelocityEngine().

Here are my properties:-

            objProps.setProperty("resource.loader", "Scaffold");
            objProps.setProperty("Scaffold.resource.loader.class",
"com.pivotal.scaffold.ScaffoldResourceLoader");
 
objProps.setProperty("Scaffold.resource.loader.templatepath", sPath +
"/WEB-INF/templates");
            objProps.setProperty("Scaffold.resource.loader.reportpath",
sPath + "/WEB-INF/report");
 
objProps.setProperty("Scaffold.resource.loader.testreportpath", sPath +
"/WEB-INF/report/test");
            objProps.setProperty("Scaffold.resource.loader.macrospath",
sPath + "/WEB-INF/macros");
 
objProps.setProperty("Scaffold.resource.loader.modificationCheckInterval
", "10");
            objProps.setProperty("runtime.log.logsystem.class",
"org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
            objProps.setProperty("runtime.log.logsystem.log4j.category",
"org.apache.velocity");
            objProps.setProperty("velocimacro.library",
"macros/general.inc,macros/admin.inc,macros/main.inc");
            objProps.setProperty("velocimacro.permissions.allow.inline",
"true");
 
objProps.setProperty("velocimacro.permissions.allow.inline.local.scope",
"true");
            objProps.setProperty("velocimacro.context.localscope",
"false");

I know I haven't provided a great deal to go on but apart from upgrade I
haven't changed anything - any ideas?

Steve



-----Original Message-----
From:
user-return-19294-sohara=pivotal-solutions.co.uk@velocity.apache.org
[mailto:user-return-19294-sohara=pivotal-solutions.co.uk@velocity.apache
.org] On Behalf Of mailmur
Sent: 11 September 2007 17:34
To: Velocity Users List
Subject: Re: turkish encoding problem

Somehow I tend to believe character encoding is
already broken before strings are even put into a
velocity context. 

Or is it that turkish chars are in a source template
file, they are not passed as a context variables?

What if you could use UnicodeFileResourceLoader, save
file as UTF-8withBOM marker. Use Windows
Notepad.exe/File/Save as... to do it.

Create a simple standalone test program, put some
turkish characters to a source template, add more
chars to a context variables, run template and save
output.

Upload a simple test program somwhere available. Its
sometimes hard to say anything concrete by reading a
brief newsgroup post.

--- srht <se...@gmail.com> wrote:

> 
> hi Will;
> did u look something about the problems. it s
> important for our project.
> thnks much ...
> 
> 
> srht wrote:
> > 
> > yes i use it when merging template. and it s not a
> singleton
> > 
> > thnks for reply ...
> > 
> > 
> > 
> > Will Glass-Husain-2 wrote:
> >> 
> >> That seems about right to me.  Are you calling
> velocityEngine when
> >> merging
> >> the template (be sure you don't call the
> singleton Velocity).
> >> 
> >> WILL
> >> 
> >> On 8/27/07, srht <se...@gmail.com> wrote:
> >>>
> >>>
> >>> hi
> >>> i use velocity engine with rtf template in my
> java application.
> >>> but it cant write  turkish characters truly in
> rtf file. i try set
> >>> velocity
> >>> engine encoding below.
> >>>                 Properties p = new Properties();
> >>>
> >>>                   p.setProperty(
> VelocityEngine.INPUT_ENCODING,
> >>> "Windows-1254");
> >>>                   p.setProperty(
> VelocityEngine.OUTPUT_ENCODING,
> >>> "Windows-1254");
> >>>                  
> p.setProperty(VelocityEngine.ENCODING_DEFAULT,
> >>> "Windows-1254");
> >>>   and
> >>>                   p.setProperty(
> VelocityEngine.INPUT_ENCODING,
> >>> "ISO-8859-9");
> >>>                   p.setProperty(
> VelocityEngine.OUTPUT_ENCODING,
> >>> "ISO-8859-9");
> >>>                  
> p.setProperty(VelocityEngine.ENCODING_DEFAULT,
> >>> "ISO-8859-9");
> >>>                  velocityEngine.init(p);
> >>>
> >>> but it cant work. what else can i do?
> >>> thnks for help...
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>>
>
http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a12343968
> >> 
> >> -- 
> >> Forio Business Simulations
> >> 
> >> Will Glass-Husain
> >> wglass@forio.com
> >> www.forio.com
> 
> -- 
> View this message in context:
>
http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a12590416
> Sent from the Velocity - User mailing list archive
> at Nabble.com.



 
________________________________________________________________________
____________
Tonight's top picks. What will you watch tonight? Preview the hottest
shows on Yahoo! TV.
http://tv.yahoo.com/ 


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




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


Re: turkish encoding problem

Posted by mailmur <ma...@yahoo.com>.
Somehow I tend to believe character encoding is
already broken before strings are even put into a
velocity context. 

Or is it that turkish chars are in a source template
file, they are not passed as a context variables?

What if you could use UnicodeFileResourceLoader, save
file as UTF-8withBOM marker. Use Windows
Notepad.exe/File/Save as... to do it.

Create a simple standalone test program, put some
turkish characters to a source template, add more
chars to a context variables, run template and save
output.

Upload a simple test program somwhere available. Its
sometimes hard to say anything concrete by reading a
brief newsgroup post.

--- srht <se...@gmail.com> wrote:

> 
> hi Will;
> did u look something about the problems. it s
> important for our project.
> thnks much ...
> 
> 
> srht wrote:
> > 
> > yes i use it when merging template. and it s not a
> singleton
> > 
> > thnks for reply ...
> > 
> > 
> > 
> > Will Glass-Husain-2 wrote:
> >> 
> >> That seems about right to me.  Are you calling
> velocityEngine when
> >> merging
> >> the template (be sure you don't call the
> singleton Velocity).
> >> 
> >> WILL
> >> 
> >> On 8/27/07, srht <se...@gmail.com> wrote:
> >>>
> >>>
> >>> hi
> >>> i use velocity engine with rtf template in my
> java application.
> >>> but it cant write  turkish characters truly in
> rtf file. i try set
> >>> velocity
> >>> engine encoding below.
> >>>                 Properties p = new Properties();
> >>>
> >>>                   p.setProperty(
> VelocityEngine.INPUT_ENCODING,
> >>> "Windows-1254");
> >>>                   p.setProperty(
> VelocityEngine.OUTPUT_ENCODING,
> >>> "Windows-1254");
> >>>                  
> p.setProperty(VelocityEngine.ENCODING_DEFAULT,
> >>> "Windows-1254");
> >>>   and
> >>>                   p.setProperty(
> VelocityEngine.INPUT_ENCODING,
> >>> "ISO-8859-9");
> >>>                   p.setProperty(
> VelocityEngine.OUTPUT_ENCODING,
> >>> "ISO-8859-9");
> >>>                  
> p.setProperty(VelocityEngine.ENCODING_DEFAULT,
> >>> "ISO-8859-9");
> >>>                  velocityEngine.init(p);
> >>>
> >>> but it cant work. what else can i do?
> >>> thnks for help...
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>>
>
http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a12343968
> >> 
> >> -- 
> >> Forio Business Simulations
> >> 
> >> Will Glass-Husain
> >> wglass@forio.com
> >> www.forio.com
> 
> -- 
> View this message in context:
>
http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a12590416
> Sent from the Velocity - User mailing list archive
> at Nabble.com.



      ____________________________________________________________________________________
Tonight's top picks. What will you watch tonight? Preview the hottest shows on Yahoo! TV.
http://tv.yahoo.com/ 


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


Re: turkish encoding problem

Posted by srht <se...@gmail.com>.
hi Will;
did u look something about the problems. it s important for our project.
thnks much ...


srht wrote:
> 
> yes i use it when merging template. and it s not a singleton
> 
> thnks for reply ...
> 
> 
> 
> Will Glass-Husain-2 wrote:
>> 
>> That seems about right to me.  Are you calling velocityEngine when
>> merging
>> the template (be sure you don't call the singleton Velocity).
>> 
>> WILL
>> 
>> On 8/27/07, srht <se...@gmail.com> wrote:
>>>
>>>
>>> hi
>>> i use velocity engine with rtf template in my java application.
>>> but it cant write  turkish characters truly in rtf file. i try set
>>> velocity
>>> engine encoding below.
>>>                 Properties p = new Properties();
>>>
>>>                   p.setProperty( VelocityEngine.INPUT_ENCODING,
>>> "Windows-1254");
>>>                   p.setProperty( VelocityEngine.OUTPUT_ENCODING,
>>> "Windows-1254");
>>>                   p.setProperty(VelocityEngine.ENCODING_DEFAULT,
>>> "Windows-1254");
>>>   and
>>>                   p.setProperty( VelocityEngine.INPUT_ENCODING,
>>> "ISO-8859-9");
>>>                   p.setProperty( VelocityEngine.OUTPUT_ENCODING,
>>> "ISO-8859-9");
>>>                   p.setProperty(VelocityEngine.ENCODING_DEFAULT,
>>> "ISO-8859-9");
>>>                  velocityEngine.init(p);
>>>
>>> but it cant work. what else can i do?
>>> thnks for help...
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a12343968
>>> Sent from the Velocity - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>>> For additional commands, e-mail: user-help@velocity.apache.org
>>>
>>>
>> 
>> 
>> -- 
>> Forio Business Simulations
>> 
>> Will Glass-Husain
>> wglass@forio.com
>> www.forio.com
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a12590416
Sent from the Velocity - User mailing list archive at Nabble.com.


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


Re: turkish encoding problem

Posted by srht <se...@gmail.com>.
yes i use it when merging template. and it s not a singleton

thnks for reply ...



Will Glass-Husain-2 wrote:
> 
> That seems about right to me.  Are you calling velocityEngine when merging
> the template (be sure you don't call the singleton Velocity).
> 
> WILL
> 
> On 8/27/07, srht <se...@gmail.com> wrote:
>>
>>
>> hi
>> i use velocity engine with rtf template in my java application.
>> but it cant write  turkish characters truly in rtf file. i try set
>> velocity
>> engine encoding below.
>>                 Properties p = new Properties();
>>
>>                   p.setProperty( VelocityEngine.INPUT_ENCODING,
>> "Windows-1254");
>>                   p.setProperty( VelocityEngine.OUTPUT_ENCODING,
>> "Windows-1254");
>>                   p.setProperty(VelocityEngine.ENCODING_DEFAULT,
>> "Windows-1254");
>>   and
>>                   p.setProperty( VelocityEngine.INPUT_ENCODING,
>> "ISO-8859-9");
>>                   p.setProperty( VelocityEngine.OUTPUT_ENCODING,
>> "ISO-8859-9");
>>                   p.setProperty(VelocityEngine.ENCODING_DEFAULT,
>> "ISO-8859-9");
>>                  velocityEngine.init(p);
>>
>> but it cant work. what else can i do?
>> thnks for help...
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a12343968
>> Sent from the Velocity - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: user-help@velocity.apache.org
>>
>>
> 
> 
> -- 
> Forio Business Simulations
> 
> Will Glass-Husain
> wglass@forio.com
> www.forio.com
> 
> 

-- 
View this message in context: http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a12363339
Sent from the Velocity - User mailing list archive at Nabble.com.


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


Re: turkish encoding problem

Posted by Will Glass-Husain <wg...@gmail.com>.
That seems about right to me.  Are you calling velocityEngine when merging
the template (be sure you don't call the singleton Velocity).

WILL

On 8/27/07, srht <se...@gmail.com> wrote:
>
>
> hi
> i use velocity engine with rtf template in my java application.
> but it cant write  turkish characters truly in rtf file. i try set
> velocity
> engine encoding below.
>                 Properties p = new Properties();
>
>                   p.setProperty( VelocityEngine.INPUT_ENCODING,
> "Windows-1254");
>                   p.setProperty( VelocityEngine.OUTPUT_ENCODING,
> "Windows-1254");
>                   p.setProperty(VelocityEngine.ENCODING_DEFAULT,
> "Windows-1254");
>   and
>                   p.setProperty( VelocityEngine.INPUT_ENCODING,
> "ISO-8859-9");
>                   p.setProperty( VelocityEngine.OUTPUT_ENCODING,
> "ISO-8859-9");
>                   p.setProperty(VelocityEngine.ENCODING_DEFAULT,
> "ISO-8859-9");
>                  velocityEngine.init(p);
>
> but it cant work. what else can i do?
> thnks for help...
>
>
> --
> View this message in context:
> http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a12343968
> Sent from the Velocity - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>


-- 
Forio Business Simulations

Will Glass-Husain
wglass@forio.com
www.forio.com

Re: turkish encoding problem

Posted by srht <se...@gmail.com>.
thnks leo

i have already solved the problem like the way u said that
sorry that i didnt write to here. i was busy
thnks to everyone....


leo83 wrote:
> 
> hi
> 
> You should set character encoding in input and output stream for rtf
> template and output file.
> 
> 
> 
> srht wrote:
>> 
>> hi
>> i use velocity engine with rtf template in my java application.
>> but it cant write  turkish characters truly in rtf file. i try set
>> velocity engine encoding below. 
>> 		Properties p = new Properties();
>> 		
>> 		  p.setProperty( VelocityEngine.INPUT_ENCODING, "Windows-1254");
>> 		  p.setProperty( VelocityEngine.OUTPUT_ENCODING, "Windows-1254");
>> 		  p.setProperty(VelocityEngine.ENCODING_DEFAULT, "Windows-1254");
>>   and 
>> 		  p.setProperty( VelocityEngine.INPUT_ENCODING, "ISO-8859-9");
>> 		  p.setProperty( VelocityEngine.OUTPUT_ENCODING, "ISO-8859-9");
>> 		  p.setProperty(VelocityEngine.ENCODING_DEFAULT, "ISO-8859-9");
>> 	         velocityEngine.init(p);
>> 
>> but it cant work. what else can i do?
>> thnks for help...
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a13015040
Sent from the Velocity - User mailing list archive at Nabble.com.


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


Re: turkish encoding problem

Posted by leo83 <pi...@gmail.com>.
hi

You should set character encoding in input and output stream for rtf
template and output file.



srht wrote:
> 
> hi
> i use velocity engine with rtf template in my java application.
> but it cant write  turkish characters truly in rtf file. i try set
> velocity engine encoding below. 
> 		Properties p = new Properties();
> 		
> 		  p.setProperty( VelocityEngine.INPUT_ENCODING, "Windows-1254");
> 		  p.setProperty( VelocityEngine.OUTPUT_ENCODING, "Windows-1254");
> 		  p.setProperty(VelocityEngine.ENCODING_DEFAULT, "Windows-1254");
>   and 
> 		  p.setProperty( VelocityEngine.INPUT_ENCODING, "ISO-8859-9");
> 		  p.setProperty( VelocityEngine.OUTPUT_ENCODING, "ISO-8859-9");
> 		  p.setProperty(VelocityEngine.ENCODING_DEFAULT, "ISO-8859-9");
> 	         velocityEngine.init(p);
> 
> but it cant work. what else can i do?
> thnks for help...
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/turkish-encoding-problem-tf4334216.html#a13000881
Sent from the Velocity - User mailing list archive at Nabble.com.


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