German special characters Ää, Öö, Üü, ß are displaying incorrectly in LiveLink or opentext

StackOverflow https://stackoverflow.com/questions/17962178

  •  04-06-2022
  •  | 
  •  

Question

I have Document and folder in Live link containing German special characters Ää, Öö, Üü, ß. I extracted the document and folder name using following code of LiveLink API server version 9.2.0.0 and client version API version of LiveLink 9.5.0.0.

string encodedName = LLValueUtil.GetValue(mainLLObj, "Name").TrimEnd('.');
int charIndex = 0;

while (Array.IndexOf(WhitespaceChars, encodedName[charIndex]) >= 0) {
    string replacement = System.Xml.XmlConvert.EncodeName(encodedName[charIndex].ToString());
    encodedName = encodedName.Substring(0, charIndex) + replacement + encodedName.Substring(charIndex + 1);
    charIndex += replacement.Length;
}

charIndex = encodedName.Length - 1;
// Replaces trailing WhitespaceChars

while (Array.IndexOf(WhitespaceChars, encodedName[charIndex]) >= 0) {
    string replacement = System.Xml.XmlConvert.EncodeName(encodedName[charIndex].ToString());
    string lastPart = encodedName.Substring(charIndex + 1);
    encodedName = encodedName.Substring(0, charIndex) + replacement + lastPart;
    charIndex = encodedName.Length - replacement.Length - lastPart.Length - 1;
}

string documentName = encodedName; // give fine File name

this code works fine in Livelink sever API version 9.5.0.0. but does not work in LiveLink API server version 9.7.1. Could you help me fixing for this issue ?

Was it helpful?

Solution

Go to admin panel of server Livelink/livelink.exe?func=admin.sysvars and set Character Set: UTF-8 and code section change as follow

    byte[] bytes = Encoding.Default.GetBytes(value); 
    var retValue = Encoding.UTF8.GetString(bytes);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top