Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #28600

Re: javax.mail sends mail with broken charset

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail
From Lars Enderin <lars.enderin@telia.com>
Newsgroups comp.lang.java.programmer
Subject Re: javax.mail sends mail with broken charset
Date Thu, 29 May 2014 11:56:39 +0200
Organization albasani.net
Lines 30
Message-ID <53870457.5060806@telia.com> (permalink)
References <lm3vnf$cr9$1@news.m-online.net> <lm6n0g$atq$1@news.m-online.net> <lm6nti$mtp$1@news.m-online.net>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 8bit
X-Trace news.albasani.net oNmMNxNE/a/Lrc/TuxaLAw85q+TeGQQtrlXDQMSU15pxe/IZ8mpcNobVd+pPbfi7C3AFi0e+Fjjos7UULSFwRKFhqsEJqWFhpHKKsEtbrtbqfv3H5zwC96o/oBLmAXmy
NNTP-Posting-Date Thu, 29 May 2014 09:56:48 +0000 (UTC)
Injection-Info news.albasani.net; logging-data="DRqLv0zNCCGOw7A/6RW6Rfgf59khHvNcapqp9s81DG5OSXqmTA61xftLMC+f5ptqED5MtvlIMZDqqOxDQCzf66ipwTXc1LpF7fZkfRgfOOmPYTuuPiiSjGNgFzpkZIzW"; mail-complaints-to="abuse@albasani.net"
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
In-Reply-To <lm6nti$mtp$1@news.m-online.net>
Cancel-Lock sha1:snHorKCooB5B+oYq71bN80f7Ajs=
Xref csiph.com comp.lang.java.programmer:28600

Show key headers only | View raw


2014-05-29 09:35, Laura Schmidt skrev:
> On 05/29/2014 09:19 AM, Laura Schmidt wrote:
> 
>> the following change to my code solved the problem:
> 
> .... but I don't know why. The new mail reads like this:
> 
> Message-ID:
> <22731732.1.1401347792347.JavaMail.tomcat7@h1403230.stratoserver.net>
> Subject: Test
> MIME-Version: 1.0
> Content-Type: text/plain;charset=utf-8
> Content-Transfer-Encoding: quoted-printable
> Date: Thu, 29 May 2014 09:16:32 +0200 (CEST)
> 
> Test: =C3=A4=C3=9F
> 
> The header is the same, but the code for "äß" changed from "=E4=DF " to
> "=C3=A4=C3=9F".
> 

That looks right. To see the original characters, you need a mail client
or other program that understands quoted-printable. In your first
attempt, you seem to have used ISO-8859-1 as the default encoding. What
default encoding does the JVM assume? Inside Java, the characters are
encoded as 16-bit characters, a form of UTF-16. The encoding only
matters when you write to or from a byte stream or file.

-- 
Lars Enderin

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

javax.mail sends mail with broken charset Laura Schmidt <ls@mailinator.com> - 2014-05-28 08:30 +0200
  Re: javax.mail sends mail with broken charset Lars Enderin <lars.enderin@telia.com> - 2014-05-28 11:13 +0200
    Re: javax.mail sends mail with broken charset Lars Enderin <lars.enderin@telia.com> - 2014-05-28 11:24 +0200
    Re: javax.mail sends mail with broken charset Joerg Meier <joergmmeier@arcor.de> - 2014-05-29 12:55 +0200
  Re: javax.mail sends mail with broken charset Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2014-05-28 09:01 -0500
  Re: javax.mail sends mail with broken charset Laura Schmidt <ls@mailinator.com> - 2014-05-29 09:19 +0200
    Re: javax.mail sends mail with broken charset Laura Schmidt <ls@mailinator.com> - 2014-05-29 09:35 +0200
      Re: javax.mail sends mail with broken charset Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-05-29 09:48 +0000
      Re: javax.mail sends mail with broken charset Lars Enderin <lars.enderin@telia.com> - 2014-05-29 11:56 +0200
      Re: javax.mail sends mail with broken charset Laura Schmidt <ls@mailinator.com> - 2014-05-30 12:16 +0200
        Re: javax.mail sends mail with broken charset Lars Enderin <lars.enderin@telia.com> - 2014-05-30 13:22 +0200
          Re: javax.mail sends mail with broken charset Lars Enderin <lars.enderin@telia.com> - 2014-05-30 20:01 +0200
  Re: javax.mail sends mail with broken charset Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2014-05-29 09:43 +0000
  Re: javax.mail sends mail with broken charset Roedy Green <see_website@mindprod.com.invalid> - 2014-05-29 15:31 -0700

csiph-web