4 Replies Latest reply on Sep 10, 2007 10:35 AM by koen.aers

    gpd.xml and utf8

    lmichenaud

      Hi,

      If i have specials characters in the node name, i get
      the error when jbpm tries to read the gpd.xml :
      Invalid byte 2 of 3-byte UTF-8 sequence

      I'm on Windows.
      The gpd.xml header specify UTF-8 but when i look
      at the file encoding, it is not in UTF-8.
      That explains the error.

      Is there a solution for that ?

      Thanks


        • 1. Re: gpd.xml and utf8
          koen.aers

          It has been reported before and AFAIR there is also a JIRA issue for it. But I am on Linux and I have not been able to reproduce the issue :-(

          • 2. Re: gpd.xml and utf8
            lmichenaud

            Maybe you should not specify the encoding in
            the xml header.

            I have looked at the designer source code and i have seen
            several things like that :

            buffer.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            buffer.append("\n\n<root-container />");


            or maybe you could try to do something like that :

            buffer.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
            buffer.append("\n\n<root-container />");
            return new ByteArrayInputStream(
             new String(buffer.toString().getBytes(),"UTF-8");


            • 3. Re: gpd.xml and utf8
              jeffj55374

              Hi,
              I believe the second code suggesting is better. We also do mixed Windows / Unix / Linux development and use UTF-8 encoded files. Java on Windows does not default to UTF-8 but some Windows specific code page so we always have to explicitly specify the encoding of our files and byte streams so that we get identical behavior across platforms.

              return new ByteArrayInputStream(
               new String(buffer.toString().getBytes(),"UTF-8");

              Thanks,
              Jeff

              • 4. Re: gpd.xml and utf8
                koen.aers

                Thanks for the suggestion guys!

                I have looked up the JIRA issue (http://jira.jboss.com/jira/browse/GPD-98) and added a reference to this forum post. It will soon be fixed.

                Regards,
                Koen