From dev-return-20817-apmail-openjpa-dev-archive=openjpa.apache.org@openjpa.apache.org Fri Jul 27 15:20:36 2012 Return-Path: X-Original-To: apmail-openjpa-dev-archive@www.apache.org Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 650ADD43F for ; Fri, 27 Jul 2012 15:20:36 +0000 (UTC) Received: (qmail 2249 invoked by uid 500); 27 Jul 2012 15:20:36 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 2148 invoked by uid 500); 27 Jul 2012 15:20:36 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 2078 invoked by uid 99); 27 Jul 2012 15:20:35 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jul 2012 15:20:35 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 51266142856 for ; Fri, 27 Jul 2012 15:20:35 +0000 (UTC) Date: Fri, 27 Jul 2012 15:20:35 +0000 (UTC) From: "Albert Lee (JIRA)" To: dev@openjpa.apache.org Message-ID: <963354423.110715.1343402435335.JavaMail.jiratomcat@issues-vm> In-Reply-To: <100509804.57402.1342440754759.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Updated] (OPENJPA-2231) jest TokenReplacedStream use Reader instead of Inputstream MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/OPENJPA-2231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Albert Lee updated OPENJPA-2231: -------------------------------- Patch Info: Patch Available > jest TokenReplacedStream use Reader instead of Inputstream > ----------------------------------------------------------- > > Key: OPENJPA-2231 > URL: https://issues.apache.org/jira/browse/OPENJPA-2231 > Project: OpenJPA > Issue Type: Improvement > Components: jpa > Affects Versions: 2.2.0 > Reporter: Herman Vierendeels > Assignee: Albert Lee > Priority: Trivial > Labels: jest > Fix For: 2.2.0 > > Attachments: OPENJPA-2231.patch > > > 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); -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira