简体   繁体   中英

My Chinese characters change to question marks in an email

I retrieve a value from a DB field which looks like two boxes [][] in the sql/developer. When I copy and paste that value to outlook (new message window) and send it to myself I can see the correct Chinese characters in the email 测试.

However If I do that via java code, meaning retrieve the value from db and send the email from java I get two ?? question marks in the resulting email in outlook.

The original setting in java code was:

Content-Type: text/plain;

I also tried to send the email with these settings:

Content-Type: text/plain; charset=UTF-8
Content-Type: text/html; charset=UTF-8

Nothing helped. Any ideas?

您还需要将连接编码设置为utf-8

jdbc:mysql://localhost/some_db?characterEncoding=UTF-8

Try changing it in your control panel

Control Panel -> Regional and Language Options

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM