roxen.lists.roxen.general

Subject Author Date
Re: Encoding?, incantation? Martin Stjernholm <mast[at]roxen[dot]com> 07-04-2009
"Stephen R. van den Berg" <<srb[at]cuci.nl>> wrote:

> I.e. I already verified that the database contains a real 2010 characters
> binary, at RXML level the variable confirms that it contains that
> number of characters.  However, as soon is it gets sent to the browser
> it ends up being around 3045 bytes (most likely an UTF-8 output conversion).

It looks like you're getting something in id->output_charset. The only
place I could find after a quick scan is via a <charset out=...> tag
(which you don't have), and a charset setting in the file system.
Maybe you can figure out how it gets set.

> Anybody know the magic <value> incantation to convince Roxen *not* to
> perform any character conversions on the output prior to transmission?

Doubt it'd help since the encoding probably takes place later (in
RequestID.make_response_headers according to my theory, but please
check). But it could help you write your code with a bit nicer
indentation:

<value type="string">
  <emit source=sql scope=o query="SELECT
      (uimg(:imid,:language)).img,
      (SELECT mimetype FROM objtype ot
        WHERE ot.otid=(uimg(:imid,:language)).otid
        LIMIT 1) AS mimetype"
    bindings="imid=form.imid,language=user.language">
    <header name="Content-Type" value="&_.mimetype;"/>
    &o.img;
  </emit>
</value>