Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: QueryComponent MDX and Intl Characters

  1. #1
    Join Date
    Mar 2009

    Default QueryComponent MDX and Intl Characters

    We have encoutered a problem using the Query component with CDF using an MDX statement that refers to a member that has accented characters.

    Ex.: SELECT [Time].[Month].[Décembre] on ...

    No results are returned. I traced as far as I could and it seems that the URL is encoded.

    If I copy and paste the url for the call (obtained from firebug),
    CDF produces this string for the month: d%C3%A9cembre and no results are return.

    if I change it for Décembre on the URL, it works. (In fact, Firefox chages it automaticaly after calling the url once.

    I tried encoding my string but it does not work either

    Ex.: mdx = "SELECT .... [Time].[Month]." + encoreURIComponent(monthname) ...

    The problem is not there using Chart components. Probable because the chart component uses a POST instead of a GET ?

    any suggestions ? This really puts a hold on realeasing our dashboards.


  2. #2
    Join Date
    Jul 2008


    I am having the same problem. I have tried to encode my string before sending it into mdx query. But with no result as it is mdx-component that can't work with it...Maybe it is a bug?

    Try to use instead unescape("%E9") instead of é.
    Like this
    mdx = "SELECT .... [Time].[Month].[D" + unescape("%E9") + "cembre]"

    Let me know how it goes...
    Last edited by TRIII; 06-29-2010 at 10:13 AM.

  3. #3
    Join Date
    Jul 2007


    The best way is for you to use a numeric as the id and columnCaption as a name. Those encoding issues are a PITA
    Pedro Alves
    Meet us on ##pentaho, a FreeNode irc channel

  4. #4
    Join Date
    Jul 2008


    ya where it is possible. The problem in my case is that the value in the database contains these characters and there is no way that i can substitute the it with an id...

  5. #5
    Join Date
    Mar 2009


    We found a way to bypass this problem.

    It seems that the xAction that CDF uses is not expecting URL tranformed strings, nor UTF-8.

    I modified jpivot.xaction and jtable.xaction (in C:\pentaho\biserver-ce\pentaho-solutions\cdf\components) to include a small javascript function to transform the incoming string in a more usable form for the underling processing. The script converts from UTF-8 to ANSI.

    The script in inserted as the first step for both xAction.

    Scipt can be tailored according to the variable names used in the xAction.

    for(var a, b, i = -1, l = (QUERY = QUERY.split("")).length, o = String.fromCharCode, c = "charCodeAt"; ++i < l;
      ((a = QUERY[i][c](0)) & 0x80) &&
      (QUERY[i] = (a & 0xfc) == 0xc0 && ((b = QUERY[i + 1][c](0)) & 0xc0) == 0x80 ?
       o(((a & 0x03) << 6) + (b & 0x3f)) : o(128), QUERY[++i] = "")
    query2 = QUERY.join("");
    Last edited by haubuchon; 09-03-2010 at 01:09 PM.

  6. #6


    There´s a better solution. It was hard to find it but it works for me:

    1. Edit catalina tomcat´s startup script and add the following: CATALINA_OPTS="-Dfile.encoding=UTF-8"
    2. Edit tomcat/conf/web.xml configuration file and add the following to the connector tag: URIEncoding="UTF-8"

    I found these issues with intl character have nothing to do with CDF, javascript, xaction, etc but with Tomcat configuration and the way Tomcat manage the stream. In JIRA you can see some cases related to this that helped me to find the solution.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.