Java mail encoding non english characters

后端 未结 3 366
日久生厌
日久生厌 2020-12-16 22:27

Using the code below i can send an email written in non-english and although the subject appears correctly the body appears as gibberish.
Any ideas?
Thank you

<
3条回答
  •  感情败类
    2020-12-16 22:59

    If nothing else helps, try changing an encoding of your source files (including .java files) to UTF8. In Eclipse it is done via Window -> Preferences -> General -> Workspace : Text file encoding I had CP1252 as a default for my text files.

    I am getting my text from .properties files. Changing them to UTF8 didn't help. This is insane, but switching my .java files to UTF8 solved my issue!

提交回复
热议问题