简体   繁体   中英

Is it possible to translate only special characters to unicode?

I have text files that contains polish characters (like 'ń') but I can't display them like this (i get '?' in places of this special characters). My solution is to use unicode codes like

ń

for 'ń' and so on, for example polish word "koń" would look like

koń

When I used

org.apache.commons.lang3.StringEscapeUtils.unescapeHtml4("ń")

I get String containing "ń", so i thought escapeHtml4 method for "ń" will give me String containing

"ń" 

as a result but i get "ń" again. Is there a simple way to do this?

You've said you're using UTF-8 and sending email. You'll need to tell the email layer to include

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

...in the email headers; sadly, email clients tend to ignore the equivalent meta tag in the email's HTML. More in this article .

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