You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Nathan Bubna <na...@esha.com> on 2003/12/02 03:37:27 UTC

Re: Character encoding issues with the new tiles tool

Slavik Markovich said:
> I'm trying to use the new tiles tool and having problems with
> Hebrew characters.
> To be specific, I've set up velocity to use Cp1255 (Hebrew-windows)
> or ISO-8859-8 in the velocity properties file.
>
> If I add Hebrew text in the main template or not use the tiles tool,
> everything is fine.
> If I'm using tiles and have Hebrew in one of the tiles, it appears as
> question marks.

if the Hebrew works fine in the main template, but not in a tile definition,
then it sounds to me like an issue with Tiles.  i don't know much about Tiles
though, so i'm really not sure.  i was kinda hoping someone more familiar with
Tiles could point you in the right direction.

here's a question, can you do this with JSP?  also, have you tried asking for
help with this on the struts-user list?  someone there may have a better idea
of what's going on.

> I believe it has something to do with double translation that happens
> when first the velocity tile is parsed and included (Hebrew characters
> get translated) and then the template is parsed and characters are
> again translated but this is just a guess.

no, the TilesTool doesn't work like that.  the output of a call to
$tiles.get('my_tile') is not parsed as part of the template it is found in.
in other words, each tile is parsed and rendered separately, the result of
which is included *as-is* in the final output.  hmm.  could this problem have
something to do with a tile being in one encoding and the template it's
included in being in an incompatible one?

> I'm using jdk1.3.1 on windows with velocity 1.3.1 and
> velocity-tools 1.1 beta.

Disclaimer:  i am not an expert in Tiles or encoding issues.  so, if anything
i said above is nonsense, i apologize.

Nathan Bubna
nathan@esha.com


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


Re: Character encoding issues with the new tiles tool

Posted by "Marino A. Jonsson" <ma...@hotmail.com>.
Nathan said:
> if the Hebrew works fine in the main template, but not in a tile
definition,
> then it sounds to me like an issue with Tiles.  i don't know much about
Tiles
> though, so i'm really not sure.  i was kinda hoping someone more familiar
with
> Tiles could point you in the right direction.

Tiles deals only with the _name_ of the resource - not the resource itself.
Tiles doesn't have anything to do with character sets and rendering so I
can't see how Tiles could have anything to do with this.  The TilesTool uses
ImportSupport to import the resource (tile), and ImportSupport uses
RequestDispatcher to include the resource.  Both the layout template and the
tile to be included are thus rendered by VelocityViewServlet (I am assuming,
of course, that both files are velocity templates).

> hmm.  could this problem have
> something to do with a tile being in one encoding and the template it's
> included in being in an incompatible one?

that would be my question too, since the encoding of the Writer is set when
it is first opened, so everything included in that page will be _emitted_
using that common encoding (AFAIK)  :)

cheers,
Marin?




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