Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1045

How to Encode ascent character into UTF-8 without losing its representation?

$
0
0

Method:

public static void test() throws IOException {        String input = "ABCÉÔpqr"; // charsetName = ISO-8859-1        String utf8String = new String(StandardCharsets.UTF_8.encode(input).array());    }

Required Output:

Output : "ABCÉÔpqr" Encoding : UTF-8

I wanted to convert String "ABCÉÔpqr" into its UTF-8 encoding without loosing its representation.

Current Output:

Output : "ABC��pqr"

Viewing all articles
Browse latest Browse all 1045

Trending Articles