From users-return-26890-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Tue Mar 08 11:03:52 2011 Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 80027 invoked from network); 8 Mar 2011 11:03:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 8 Mar 2011 11:03:51 -0000 Received: (qmail 70132 invoked by uid 500); 8 Mar 2011 11:03:51 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 70087 invoked by uid 500); 8 Mar 2011 11:03:51 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 70079 invoked by uid 99); 8 Mar 2011 11:03:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Mar 2011 11:03:51 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of gary.tully@gmail.com designates 209.85.216.171 as permitted sender) Received: from [209.85.216.171] (HELO mail-qy0-f171.google.com) (209.85.216.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Mar 2011 11:03:47 +0000 Received: by qyj19 with SMTP id 19so2954761qyj.2 for ; Tue, 08 Mar 2011 03:03:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=7XI+mkV0czeLhnnDkM2DhtckWDomHTMunwav3gHHMzU=; b=ZysAoklglIwhdhTUvJrqjbB3wNqZ1G0eYqJ8YHPqV5mSq/COFKYXfLmoeeru4rOUEQ v9tB1P8lcrRjdh+0yJEYbCdiwM/1S5En+Y5JIcGJCaVe0DxB+oyP9bH09L6wu5nAykJf VRUFT3mjYi9xzVxD5MrnJk2CSCr/ioQGPOUgo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=vx8C86kVc47V8UxuygHWZEk5DixVaGAQwzNCh/sRGBnDXYkqv/Liyrwe3Tdu8cB5HH AufDdjVbUBt2aNu6cG4O9ODWJCmKplmsGtF2lc4qT+czwF0KSxomYZVfNUJ7HxC7OBtu CqKh9cwgH8+ij1DnBKrMI7ivzl8zf3xeS0i2w= MIME-Version: 1.0 Received: by 10.229.101.135 with SMTP id c7mr3766077qco.185.1299582205488; Tue, 08 Mar 2011 03:03:25 -0800 (PST) Received: by 10.229.226.207 with HTTP; Tue, 8 Mar 2011 03:03:25 -0800 (PST) In-Reply-To: <1299516404345-3339428.post@n4.nabble.com> References: <1299516404345-3339428.post@n4.nabble.com> Date: Tue, 8 Mar 2011 11:03:25 +0000 Message-ID: Subject: Re: Character encoding problem of the messages in queue From: Gary Tully To: users@activemq.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Text is encoded in utf-8, your call to getText() below is the unmarshaled state as the original message is copied on send. see the source here: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org= /apache/activemq/command/ActiveMQTextMessage.java?revision=3D1074725&view= =3Dmarkup If you need utf-16, you will need to use a bytes message. On 7 March 2011 16:46, RuralHunter wrote: > Hi, I'm using Activemq 5.4.2 on Ubuntu server. > I put text message with java by these codes: > TextMessage message =3D session.createTextMessage(myText); > =A0 =A0 =A0 =A0producer.send(message); > =A0 =A0 =A0 =A0myLogger.finest("Sent message:"); > =A0 =A0 =A0 =A0myLogger.finest(message.getText()); > > "myText" contains some Chinese characters. and I can see characters are > correct in the log output above. But when I get the message from either > another java program or by the web admin console, I can see the Chinese > characters become "????". I guess some character encoding transformation > happened when the messages put into the queue. What should I do to make t= he > Chinese characters correct in the queue? Is there a charset/encoding > parameter I can set for the broker or queue or maybe the JVM? > > btw, I used to use 5.4.x(some old version) before on windows and didn't s= ee > this problem. > > -- > View this message in context: http://activemq.2283324.n4.nabble.com/Chara= cter-encoding-problem-of-the-messages-in-queue-tp3339428p3339428.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > --=20 http://blog.garytully.com http://fusesource.com