3 Replies Latest reply on Oct 14, 2007 11:15 AM by Nicklas Karlsson

    Encoding problem

    Nicklas Karlsson Master

      Yup, the dreaded "Invalid byte 2 of 4-byte UTF-8 sequence".

      I have @WebService annotated methods that handle entities with iso-8859-1 encoding. Is there any way of telling JBoss to do UTF-8 encoding when generating the WSDL-document?

        • 1. Re: Encoding problem
          Oskar Carlstedt Novice

          Hello!

          You can start JBoss with the file.encoding parameter

          -Dfile.encoding=UTF-8
          


          Be careful when doing this because you will treat all files as UTF-8-encoded if nothing else is given. OK, I haven't had any problems doing this on all our servers, but it is worth an extra note.


          Regards,
          Oskar


          • 2. Re: Encoding problem
            Nicklas Karlsson Master

            The file encoding didn't work out that well since everything else broke ;-)

            Well, now the wsdl file is correctly UTF-8 encoded but the problem seems to be a JBossWS_remote._24540.xsd (schema validation?). The file has the original iso-8859-1 chars and no encoding info -> tilt.

            Is there any way of hinting the encoding for the .xsd? Sure, I could strip the entities from all non-utf chars but since they are quite central that would lead to refactoring everywhere so if there is I a workaround, I'm more than happy to listen.

            • 3. Re: Encoding problem
              Nicklas Karlsson Master

              Any theories as to why the wsdl file is correctly encoded but the .xsd is not? Since they both are generated from the same information, one would assume the encodings would match(?)