java - The danish character not showing after convert from utf8 to iso-8859-1 -


i taking radio stream , trying read metadata. contains danish character showing ? marks, tried below conversion

string s = new string(streammetadatastring.getbytes(standardcharsets.utf_16), standardcharsets.iso_8859_1); 

now removed ? marks showing wrong characters. tried other ways not getting right values.

a line of code posted:

string s = new string(streammetadatastring.getbytes(standardcharsets.utf_16),                           standardcharsets.iso_8859_1); 

does not useful.

a character encoding mapping characters bytes , vice versa. doing in line of code convert string bytes using utf-16 character encoding, , convert bytes string using iso-8859-1 encoding. not produce useful - bytes contain utf-16 encoded characters, not iso-8859-1 encoded characters.

to make danish characters display correctly, must make sure wherever display (the command prompt window? linux shell? html page? gui?) uses font contains characters, , specify correct character encoding (how that, depends on display characters).


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -