This assumes that the char set of original text was UTF-8 before it was encoded with Base64 and stored to the file.
If this sequence does not give you the expected output in proper Japanese, your assumption about the charset of the input text was probably wrong, and you should try something else instead of UTF-8. Possible settings are
and not to forget the variants of UTF (UTF-16, UTF-32 and alike).
Not all the charsets mentioned above are available in Java/Pega OOTB. Try
for( String name : java.nio.charset.Charset.availableCharsets().keySet() )
System.out.println( name );
to get a list of all the charsets available on your machine.
But you should also make sure that you use the correct font to display the result of the conversion: even when the conversion works correctly, the font that you use to display the Japanese string may not contain the proper glyphs to show the Japanese characters - and you see the question-mark-diamonds on the screen, although the itself text is proper.
I converted it to UTF-8 but it garbled. I think there is a problem with encoding when attached. I'd like to know how to correctly encode Japanese in the encoding process of Work - Attach activity. Should I Post for SR?