strfmt "%=^V" features availibility on thunderstone version

Post Reply
gaurav.shetti
Posts: 119
Joined: Fri Feb 27, 2009 9:09 am

strfmt "%=^V" features availibility on thunderstone version

Post by gaurav.shetti »

Hi,
I am using this command:
<strfmt "%=^V" $description><$description=$ret>
on two of my environments with different versions. This command works fine on this version :

Texis Web Script (Vortex) Copyright (c) 1996-2009 Thunderstone - EPI, Inc.
Commercial Version 5.01.1249359916 20090804 (sparc-sun-solaris2.8-64-64)

But when I try running the same command in this version:

Texis Web Script (Vortex) Copyright (c) 1996-2007 Thunderstone - EPI, Inc.
Commercial Version 5.01.1171516286 20070215 (sparc-sun-solaris2.8-64-64)

It gives me a following error:
100 bulk_vontu:161: Unknown/illegal format code `=' in <strfmt> string

I have a few queries:
1. is this coming because of the version being different?
2. If so can I use a different parameter in place of this "%=^V" with strfmt command to achive the same type of results?

Regards,
jitish
User avatar
Kai
Site Admin
Posts: 1270
Joined: Tue Apr 25, 2000 1:27 pm

strfmt "%=^V" features availibility on thunderstone version

Post by Kai »

1. Yes; `=' and `^' were added in version 20080902.
2. You can duplicate the `=' (validate UTF-8) behavior by decoding and re-encoding UTF-8; the `^' (XML-safe) behavior you would need to emulate with <sandr>s to remove the unsafe characters. Assuming the source string is $ret:

<sandr "[\x00-\x08\x0B-\x0C\x0E-\x1F]" "\?" $ret>
<strfmt "%!hhV" $ret> <!-- decode UTF-8, HTML-esc -->
<sandr ">>&#=6553[45];" "\?" $ret>
<strfmt "%hV" $ret> <!-- HTML decode, UTF-8 encode -->
User avatar
mark
Site Admin
Posts: 5513
Joined: Tue Apr 25, 2000 6:56 pm

strfmt "%=^V" features availibility on thunderstone version

Post by mark »

Post Reply