简体   繁体   中英

how to convert Unicode (utf-8) to hex string in java?

how to convert a unicode string in java to hex string.

for example : st = "\م" to st = "%D9%85"

?

If you can afford Guava, go for it and use its PercentEscaper (available as of Guava 15.0).

As nearly always with Guava, well written and performs admirably.

Note that it will not encode ASCII letters or digits (az, AZ, 0-9).

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