Bug in BComponent

View: New views
3 Messages — Rating Filter:   Alert me  

Bug in BComponent

by rwaghray :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am having an issue with BComponent's (BText, BLink etc). It seems these components do follow HTML encoding standards. For example

BText bcomp = new BText("I am feeling <BR> lucky");
bcomp.setAllowMarkupInText(true);

The above statement works fine. But, when i change the language to say spanish i start getting special characters when component renders.

BText bcomp = new BText("El campo Nombre en la tarjeta de <BR> crédito es obligatorio");
bcomp.setAllowMarkupInText(true);

The above sentence renders special characters

El campo Nombre en la tarjeta de crédito es obligatorio

I would greatly appreciate any help.

Thanks
Rajeev

--
Barracuda mailing list
Barracuda@...
http://www.ow2.org/wws/lists/projects/barracuda

Re: Bug in BComponent

by matg :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Maybe you should try to use "setEncoding" method of BComponents?
BText bcomp = new BText("El campo Nombre en la tarjeta de <BR> crédito es obligatorio");
bcomp.setEncoding("UTF-8");
bcomp.setAllowMarkupInText(true);

Hope this help

rwaghray wrote:
Hi,

I am having an issue with BComponent's (BText, BLink etc). It seems
these components do follow HTML encoding standards. For example

BText bcomp = new BText("I am feeling <BR> lucky");
bcomp.setAllowMarkupInText(true);

The above statement works fine. But, when i change the language to say
spanish i start getting special characters when component renders.

BText bcomp = new BText("El campo Nombre en la tarjeta de <BR> crédito
es obligatorio");
bcomp.setAllowMarkupInText(true);

The above sentence renders special characters

El campo Nombre en la tarjeta de crédito es obligatorio

I would greatly appreciate any help.

Thanks
Rajeev



--

Barracuda mailing list

Barracuda@ow2.org

http://www.ow2.org/wws/lists/projects/barracuda

Re: Re: Bug in BComponent

by Diez B. Roggisch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thursday 07 February 2008 09:18:50 matg wrote:
> Hi,
>
> Maybe you should try to use "setEncoding" method of BComponents?
> BText bcomp = new BText("El campo Nombre en la tarjeta de <BR> crédito es
> obligatorio");
> bcomp.setEncoding("UTF-8");
> bcomp.setAllowMarkupInText(true);

It certainly is an encoding-issue, but I presume the other way round: the
result Rajeev sees comes from encoding the accented character into two
bytes - which is the UTF-8 encoding.

I presume his browser instead expects latin1, due to HTTP-headers delivered
from the server.

So either he has to change the headers announcing an encoding of UTF-8, or he
needs to set the encoding to latin1.

I would suggest the former, because then his site could handle all languages.
But of course that's his to decide.

Diez


--
Barracuda mailing list
Barracuda@...
http://www.ow2.org/wws/lists/projects/barracuda