Last active
December 28, 2015 23:09
-
-
Save cb372/7576659 to your computer and use it in GitHub Desktop.
Generating a B-encoded mail subject
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val encoding = "iso-2022-jp" | |
val subject = "こんにちは、世界" | |
val base64 = javax.xml.bind.DatatypeConverter.printBase64Binary(subject.getBytes(encoding)) | |
val bEncoded = s"=?$encoding?B?$base64?=" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment