You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by george georgovassilis <ge...@open.gr> on 2004/11/04 08:26:12 UTC

[Closed] Re: ESQL, Oracle CLOB and encoding

Thanx a lot!

That was exactly the problem. I looked up the esql.xsl and found a bunch 
of goodies in there, including the esql:get-clob tag which does exactly 
what I want. Unfortunately it either didn't make it into the esql user 
documentation (2.1.5.1) or I need a pair of new glasses, anyhow I 
overlooked it.

On a second notice, esql:get-xml seems to build on the get-ascii tag and 
likewise scrambles UTF-8 data.

Best regards
George Georgovassilis

Torsten Curdt wrote:

> george georgovassilis wrote:
>
>> Good morning Dear All
>>
>> This is a re-post from the users list where unluckily I didn't find a 
>> solution to my question.
>> So, appologies for cross-posting.
>>
>> I've run into trouble with my ESQL page. In detail:
>> I'm running an Oracle database pool and a few tables in there with 
>> CLOBs which contain UTF-8 strings.
>> The following code extracts the data quite nicely:
>>
>> oracle.sql.CLOB body =  (oracle.sql.CLOB)<esql:get-object 
>> column="body"/>;
>> String xmlbody = (body.length()&gt;0? body.getSubString(1, 
>> (int)body.length()):"");
>>
>> which returns correctly
>> <snip>
>> Το δεύτερο άρθρο στην κατηγορία 'Αγορά / Ελλάδα'
>> </snip>
>>
>> The much more elegant
>> String stripped = <esql:get-ascii column="body"/>;
>>
>> however returns garbage:
>> <snip>
>> ¤Ώ ΄µΝΔµΑΏ ¬ΑΈΑΏ ΓΔ·½ Ί±Δ·³ΏΑ―± '‘³ΏΑ¬ / •»»¬΄±'
>> </snip>
>>
>> Is there any way I still can use the esql?
>
>
> Without looking at the code esql:get-ascii implies
> ascii encoding ...but you are talking about uft-8
> encoding. maybe that's the problem.
>
> Compare the esql:get-object and esql:get-ascii
> implementations in the esql.xsl.
>
> cheers
> -- 
> Torsten
>
>



Re: [Closed] Re: ESQL, Oracle CLOB and encoding

Posted by Leszek Gawron <lg...@mobilebox.pl>.
>> On a second notice, esql:get-xml seems to build on the get-ascii tag 
>> and likewise scrambles UTF-8 data.
> 
> 
> ...specifying the encoding on the esql:get-xml tag would be a
> good thing. Same here: patches are welcome
Please at least submit an issue so it's not forgotten.

regards

-- 
Leszek Gawron                                      lgawron@mobilebox.pl

Re: [Closed] Re: ESQL, Oracle CLOB and encoding

Posted by Torsten Curdt <tc...@apache.org>.
> Thanx a lot!

no worries

> 
> That was exactly the problem. I looked up the esql.xsl and found a bunch 
> of goodies in there, including the esql:get-clob tag which does exactly 
> what I want. 

cool

> Unfortunately it either didn't make it into the esql user 
> documentation (2.1.5.1) or I need a pair of new glasses, anyhow I 
> overlooked it.

if that's the case ...you do know we also appreciate patches
for the documentation, don't you? ;-)

> On a second notice, esql:get-xml seems to build on the get-ascii tag and 
> likewise scrambles UTF-8 data.

...specifying the encoding on the esql:get-xml tag would be a
good thing. Same here: patches are welcome

cheers
--
Torsten