title: Encoding mixed language attachment filenames
body: <p>I try hard to send an email with Spring's MimeMessageHelper with an attachment with characters from different languages:</p>
  
  <pre><code>MimeMessage message = mailSender.createMimeMessage();
  MimeMessageHelper helper = new MimeMessageHelper(message, MimeMessageHelper.MULTIPART_MODE_MIXED_RELATED, StandardCharsets.UTF_8.name());
  // ...
  helper.addAttachment("éàè öäü русский алфавит.pdf", bytes, "application/pdf");
  </code></pre>
  
  <p>Whatever I do, the filename in Gmail always appears like:</p>
  
  <pre><code>?UTF-8?B?0JDQutGC0LXRgNGLLdCb0Y7QutGB0LXQvNCx0YPRgA==?= =?UTF-8?B?0LMtMjAxOS0xMSDQvNCw0Y8ucGRm?=
  </code></pre>
  
  <p>I tried:</p>
  
  <pre><code>MimeUtility.encodeText("éàè öäü русский алфавит.pdf", StandardCharsets.UTF_8.name(), "Q");
  MimeUtility.encodeWord(...) // same result
  </code></pre>
  
  <p>and also setting:</p>
  
  <pre><code>System.setProperty("mail.mime.splitlongparameters", "false");
  System.setProperty("mail.mime.encodeparameters", "false"); // or true
  System.setProperty("mail.mime.charset", "utf-8");
  </code></pre>
  
  <p>does not make a change.</p>
  
  <p>If I remove the non-cyrillic characters (éàè öäü) from the filename, then the filename is encoded well, just without any MimeUtility.encode calls.</p>
  
  <p>But in my use-case I can have mixed language filenames.</p>
  
  <p>Even when I change <code>éàè öäü русский алфавит.pdf</code> to <code>2019 русский алфавит.pdf</code> the display of the filename stays bad. But just leaving <code>русский алфавит.pdf</code> makes it display correctly in Gmail.</p>
  
  <p>Why is that?</p>
  
  <p>I use Spring Boot 1.5.21 and Java 8 on Fedora 30.</p>