Thanks Mitko,

The charset_recode suggestion does work.

http("v1_lab") does not:
  HT008: http requires string, blob or string session as argument 1

Is there a more convenient way to output UTF8 values without the explicit
charset_recode as all VSP text output from my sparql queries will be
UTF-8.


It is also clear I do not grasp the types of strings expected and returned
at various places.(wide vss narrow). A pointer to documentation would be
welcome. 

(I know sprintf('%s', "v1_lab") works, I could write a procedure I
suppose)


Thanks,

Lourens
On Wed, 9 Dec 2009 15:07:05 +0200, Mitko Iliev <[email protected]>
wrote:
> Hi Lourens,
> 
> You could use http () function instead , it will output the utf8 string
as
> is . The other way is to use http_value with wide string, i.e. utf8 
first
> should be recoded to wide : 
> "v1_lab" := charset_recode ("v1_lab", 'UTF-8', '_WIDE_') ;
> http_value ("v1_lab");
> 
> Best Regards,
> Mitko
> 
> 
> On Dec 9, 2009, at 1:23 PM, lourens wrote:
> 
>> 
>> I am trying to get special characters print correctly in a vsp page.
>> I am accessing RDF Literals. If I access them through JDBC
>> and generate web-pages the output is as I expect.
>> 
>> But outputting the value of a "sparql select" in a vsp page by a
>> http_value
>> call doesn't seem to use utf-8 encoding. I add the vsp source below.
>> 
>> Any suggestions?
>> 
>> 
>> Thanks,
>> 
>> Lourens
>> ---------------------------------------------
>> 
>> <HTML>
>>  <HEAD>
>> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
>>    <TITLE>testproc</TITLE>
>>  </HEAD>
>>  <BODY>
>> 
>> <h1>Test Proc v1</h1>
>> 
>> <p>Some UTF-8 text:Magazijn De Bijenkorf
>> <p>
>> <?vsp
>>   set http_charset='UTF-8';
>> 
>>   declare _uri varchar;
>>   _uri := 'http://goo.kb.nl/gtt/138903166';
>>   FOR (sparql select ?v1_lab 
>>        where {`iri(?:_uri)` skos:prefLabel ?v1_lab})
>>        DO {
>>        http_value("v1_lab");
>>   }
>> ?>
>> </BODY>
>> </HTML>
>> 
>>
------------------------------------------------------------------------------
>> Return on Information:
>> Google Enterprise Search pays you back
>> Get the facts.
>> http://p.sf.net/sfu/google-dev2dev
>> _______________________________________________
>> Virtuoso-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/virtuoso-users
> 
> 
> --
> Mitko Iliev
> Developer Virtuoso Team
> OpenLink Software
> http://www.openlinksw.com/virtuoso
> Cross Platform Web Services Middleware

Reply via email to