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

From Lars Enderin <lars.enderin@telia.com>
Newsgroups comp.lang.java.programmer
Subject Re: javax.mail sends mail with broken charset
Date 2014-05-29 11:56 +0200
Organization albasani.net
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>

Show all headers | 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