Webwork FastByteArrayOutputStream encoding error

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • 3.13
    • Affects Version/s: 3.7.2
    • Component/s: None
    • Environment:

      standalone, tomcat, ubuntu

    • 3.07

      User Symptoms

      When using a language that requires non-ASCII character support (e.g. Cyrillic), on some screens the non-ASCII characters are replaced with question marks. The problem does not occur in all screens. The problem appears in different locations of the Issue Browser for different issues.

      If you change one of the characters in the affected string from a two-byte character to a single-byte character, the problem may disappear for that screen.

      The problem is for non ASCII symbols traversed into UTF-8 encoding. For example - Russian locale.
      The FastByteArrayOutputStream call new String(bytes, 0, length, "UTF-8") for each part of buffered bytes and this is error. UTF-8 symbol can contains more 1 byte, and such conversion make troubles on endes of byte arrays. Please see attached patch for this class.

        1. test.zip
          3.25 MB
        2. webwork_patch_src.zip
          2 kB
        3. webwork-16May06-jiratld.jar
          367 kB
        4. webwork-30Apr07-jiratld.jar
          363 kB

            Assignee:
            Unassigned
            Reporter:
            Alexey Efimov
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 13h
                13h