I want to extract file/folder and other item type that contains some German special characters in their name from Livelink server. Livelink server has encoding UTF-8. Value is Test Dokument äöüß
var bytes = new List<byte>(value.Length);
foreach (var c in value)
bytes.Add((byte)c);
var retValue = Encoding.UTF8.GetString(bytes.ToArray());
the above code sample fixes s encoding problem in some character but ß is seen as ? character in Latin( ISO 8859-2) encoding. can anybody help me fix the problem.
Thanks in advance
It doesn't make sense to store ISO-8859-1 in a C#
string
, since it stores Unicode characters.What really makes sense is to convert the Unicode
string
into abyte[]
representing the string in ISO-8859-1.Try this and you'll see that the text file is correctly encoded.
You can even check with a hex editor or with the debugger that the ß is correctly encoded as 0xDF (see table on wikipedia)