@Test public void testEncodeBEncodedWordSplitForUnicode() throws Exception { StringBuilder sb = new StringBuilder("z"); for (int i = 0; i < 10; i++) { sb.append("\uD835\uDD6b"); } String expected = "=?UTF-8?B?evCdlavwnZWr8J2Vq/Cdlas=?= " + "=?UTF-8?B?8J2Vq/CdlavwnZWr8J2Vq/CdlavwnZWr?="; Assert.assertEquals(expected, EncoderUtil.encodeEncodedWord(sb.toString(), Usage.TEXT_TOKEN, 10, null, Encoding.B)); }
public static String encodeEncodedWord(String text, Usage usage) { return encodeEncodedWord(text, usage, 0, null, null); }
EncoderUtil { public static String encodeEncodedWord(String text, Usage usage) { return encodeEncodedWord(text, usage, 0, null, null); } }
EncoderUtil { public static String encodeEncodedWord(String text, Usage usage) { return encodeEncodedWord(text, usage, 0, null, null); } private  EncoderUtil(); }
EncoderUtil { public static String encodeEncodedWord(String text, Usage usage) { return encodeEncodedWord(text, usage, 0, null, null); } private  EncoderUtil(); static String encodeAddressDisplayName(String displayName); static String encodeAddressLocalPart(String localPart); static String encodeHeaderParameter(String name, String value); static String encodeIfNecessary(String text, Usage usage,
            int usedCharacters); static boolean hasToBeEncoded(String text, int usedCharacters); static String encodeEncodedWord(String text, Usage usage); static String encodeEncodedWord(String text, Usage usage,
            int usedCharacters); static String encodeEncodedWord(String text, Usage usage,
            int usedCharacters, Charset charset, Encoding encoding); static String encodeB(byte[] bytes); static String encodeQ(byte[] bytes, Usage usage); static void encodeQBinary(final InputStream in, final OutputStream out); static void encodeQ(final InputStream in, final OutputStream out); static void encodeB(final InputStream in, final OutputStream out); static boolean isToken(String str); }
EncoderUtil { public static String encodeEncodedWord(String text, Usage usage) { return encodeEncodedWord(text, usage, 0, null, null); } private  EncoderUtil(); static String encodeAddressDisplayName(String displayName); static String encodeAddressLocalPart(String localPart); static String encodeHeaderParameter(String name, String value); static String encodeIfNecessary(String text, Usage usage,
            int usedCharacters); static boolean hasToBeEncoded(String text, int usedCharacters); static String encodeEncodedWord(String text, Usage usage); static String encodeEncodedWord(String text, Usage usage,
            int usedCharacters); static String encodeEncodedWord(String text, Usage usage,
            int usedCharacters, Charset charset, Encoding encoding); static String encodeB(byte[] bytes); static String encodeQ(byte[] bytes, Usage usage); static void encodeQBinary(final InputStream in, final OutputStream out); static void encodeQ(final InputStream in, final OutputStream out); static void encodeB(final InputStream in, final OutputStream out); static boolean isToken(String str);  }