Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 87115 invoked from network); 30 Mar 2009 23:27:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Mar 2009 23:27:58 -0000 Received: (qmail 8044 invoked by uid 500); 30 Mar 2009 23:27:58 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 7972 invoked by uid 500); 30 Mar 2009 23:27:58 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 7959 invoked by uid 99); 30 Mar 2009 23:27:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Mar 2009 23:27:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Mar 2009 23:27:56 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C77B4234C041 for ; Mon, 30 Mar 2009 16:27:34 -0700 (PDT) Message-ID: <2001061493.1238455654815.JavaMail.jira@brutus> Date: Mon, 30 Mar 2009 16:27:34 -0700 (PDT) From: "Martin Schlapfer (JIRA)" To: dev@activemq.apache.org Subject: [jira] Commented: (AMQCPP-232) OpenWire encode and decode UTF8 incorrect In-Reply-To: <946966057.1238081262793.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/AMQCPP-232?page=3Dcom.atlas= sian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D= 50906#action_50906 ]=20 Martin Schlapfer commented on AMQCPP-232: ----------------------------------------- Tim/Peter,=20 Having just worked in this area on another piece of software, I have a few = code review comments on this patch:=20 (1) In the readString method, the transformation from UTF8 to Unicode shoul= d be limited to 1 byte (max value 255) since the UTF8 data is decoded in th= is method into a byte array. Decoding values above 255 and stuffing the val= ue into a byte value will only cause debugging problems down then road when= receiving UTF8 data with values above 255. Thus, as with the code before p= atch was applied (with values above 127) , the readString method should thr= ow an IO Exception if a Unicode value greater than 255 is encountered indic= ating "Encoding is not supported".=20 (2) For performance reasons (although not much of a factor with 1 byte Unic= ode, however greater factor in supporting 2 byte and 4 byte Unicode), bitwi= se operators should be used to decode / encode between UTF8 and Unicode rat= her than arithmetic.=20 (3) The "null character", value 0, should not be skipped. It should be trea= ted as a character and decoded / endcoded along with the rest of the charac= ters. The null character is a valid value in UTF8 and Unicode (and c++ std:= :string's). The null character is a C style string programming artifact.=20 my two cents, thanks,=20 Martin.=20 > OpenWire encode and decode UTF8 incorrect > ----------------------------------------- > > Key: AMQCPP-232 > URL: https://issues.apache.org/activemq/browse/AMQCPP-232 > Project: ActiveMQ C++ Client > Issue Type: Bug > Components: Openwire > Affects Versions: 2.2.5 > Environment: Windows XP SP 3, Visual Studio 2008 > Reporter: Peter Pfort > Assignee: Timothy Bish > Fix For: 2.2.6, 3.0 > > Attachments: OpenwireStringSupport.patch > > > Hallo, > we are using topic messages to sent messages from one user to another. Ou= r program subscribe a durable consumer with selector "UserName=3D''" = and send a message with the property "UserName" and value "". > All works fine, when contains only ASCII characters. When c= ontains non ASCII characters like =C3=A4=C3=B6=C3=BC=C3=9F=C3=A9, the messa= ge is not send to the > consumer. > The problem ist that readString and writeString in OpenwireStringSupport.= cpp have bugs > Regards, > Peter --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.