OpenJPA
  1. OpenJPA
  2. OPENJPA-2231

jest TokenReplacedStream use Reader instead of Inputstream

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.3.0
    • Component/s: jpa
    • Labels:
    • Patch Info:
      Patch Available

      Description

      in order to preserve utf-8 characters in replace-function , use Reader instead of Inputstream
      public class TokenReplacedStream {
      ...
      //public void replace(InputStream in, Writer out, String... prs) throws IOException {
      public void replace(Reader in, Writer out, String... prs) throws IOException {

      using new type:
      InputStream in=servletContext.getResourceAsStream(rsrc);
      BufferedReader in_br=new BufferedReader(new InputStreamReader(in,"UTF-8"));
      new TokenReplacedStream().replace(in_br,out_char,tokens);

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        85d 6h 22m 1 Albert Lee 09/Oct/12 19:33
        Resolved Resolved Closed Closed
        6s 1 Albert Lee 09/Oct/12 19:34
        Albert Lee made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Albert Lee made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.3.0 [ 12319463 ]
        Fix Version/s 2.2.0 [ 12315910 ]
        Resolution Fixed [ 1 ]
        Albert Lee made changes -
        Patch Info Patch Available [ 10042 ]
        Albert Lee made changes -
        Assignee Albert Lee [ allee8285 ]
        Albert Lee made changes -
        Field Original Value New Value
        Attachment OPENJPA-2231.patch [ 12538162 ]
        Hide
        Albert Lee added a comment -

        Can not remove the replace(InputStream....) method to aovid breaking application that currently using this method.

        Add a new replace(Reader...) method instead.

        Please check if this meets your need. I'll commit this change in trunk after your confirmation.

        Show
        Albert Lee added a comment - Can not remove the replace(InputStream....) method to aovid breaking application that currently using this method. Add a new replace(Reader...) method instead. Please check if this meets your need. I'll commit this change in trunk after your confirmation.
        Herman Vierendeels created issue -

          People

          • Assignee:
            Albert Lee
            Reporter:
            Herman Vierendeels
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development