【问题标题】:German special characters Ää, Öö, Üü, ß are displaying incorrectly in LiveLink or opentext德语特殊字符 Ää、Öö、Üü、ß 在 LiveLink 或 opentext 中显示不正确
【发布时间】:2013-07-31 05:19:56
【问题描述】:

我在 Live 链接中有包含德语特殊字符 Ää、Öö、Üü、ß 的文档和文件夹。我使用 LiveLink API 服务器版本 9.2.0.0 和客户端版本 API 版本 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

此代码在 Livelink 服务器 API 版本 9.5.0.0 中运行良好。但不适用于 LiveLink API 服务器版本 9.7.1。你能帮我解决这个问题吗?

【问题讨论】:

    标签: c# livelink


    【解决方案1】:

    转到服务器 Livelink/livelink.exe?func=admin.sysvars 的管理面板并设置字符集:UTF-8 和代码部分更改如下

        byte[] bytes = Encoding.Default.GetBytes(value); 
        var retValue = Encoding.UTF8.GetString(bytes);
    

    【讨论】:

      猜你喜欢
      • 2014-03-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-30
      • 2015-04-14
      相关资源
      最近更新 更多