cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Sparkes <>
Subject Binding Encoding with CForms/Dojo
Date Wed, 05 Dec 2012 09:14:19 GMT

I have built a CForm application with a multilevel level recursive form based on:

I am having problems getting it to work with UTF-8.

    "If you use CForms with ajax enabled, Cocoon will make use of under the
    which creates XMLHttpRequests that POST the form data to the server. Here Dojo decides
    encoding by default, which does not match the browser's behaviour of using the charset
    in the META tag. But you can easily tell Dojo which formatting to use for all
    calls, just include that in the top of your HTML pages, before dojo.js is included:

    <script>djConfig = { bindEncoding: "utf-8" };</script>

    You might already have other djConfig options, then simply add the bindEncoding property
to the
    hash map."

When I put the script in the template.xml, UTF-8 encoding works, However the form's recursion

I tried putting the script in forms-samples-styling.xsl which has no effect, presumably its
too late 
in the pipeline.

I assume that the application uses other djConfig options as the final html includes:

    <script  type="text/javascript">
           var djConfig = {};
            djConfig.isDebug = true;
           djConfig.locale = "en-GB";
           var cocoon;
           if (!cocoon)
             cocoon = {};
           cocoon.resourcesUri = "/_cocoon/resources";

Help please:

      * How do I add the bindEncoding property to the hash map
      * or otherwise get UTF-8 encoding working


View raw message