1

已经很晚了,我今晚的工作就完成了——有人可以帮我解决这个问题吗?我是否需要做一些额外的工作才能将这些 Unicode 字符串分配为文字?

第一次尝试创建双编码和所需键值对的哈希表:

[string] $double_encoded_values = @{
"€"   = "€";
"‚"   = "‚";
"Æ’"    = "ƒ";
"„"   = "„";
"…"   = "…";
"â€"    = "†";
"‡"   = "‡";
"ˆ"    = "ˆ";
"‰"   = "‰";
"Å"     = "Š";
"‹"   = "‹";
"Å’"    = "Œ";
"Ž"    = "Ž";
"‘"   = "‘";
"’"   = "’";
"“"   = "“";
"â€"    = "”";
"•"   = "•";
"–"   = "–";
"—"   = "—";
"Ëœ"    = "˜" ;
"â„¢"   = "™";
"Å¡"    = "š";
"›"   = "›";
"Å“"    = "œ";
"ž"    = "ž";
"Ÿ"    = "Ÿ";
"¡"    = "¡";
"¢"    = "¢";
"£"    = "£";
"¤"    = "¤";
"Â¥"    = "¥";
"¦"    = "¦";
"§"    = "§";
"¨"    = "¨";
"©"    = "©";
"ª"    = "ª";
"«"    = "«";
"¬"    = "¬";
"®"    = "®";
"¯"    = "¯";
"°"    = "°";
"±"    = "±";
"²"    = "²";
"³"    = "³";
"´"    = "´";
"µ"    = "µ";
"¶"    = "¶";
"·"    = "·";
"¸"    = "¸";
"¹"    = "¹";
"º"    = "º";
"»"    = "»";
"¼"    = "¼";
"½"    = "½";
"¾"    = "¾";
} # $double_encoded_values

我的版本:

PS C:\Windows\system32> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
4      0      -1     -1     

收到错误:

At line:20 char:12
    + "–"   = "–";
    +            ~
    Missing '=' operator after key in hash literal.
    At line:20 char:12
    + "–"   = "–";
    +            ~
    The hash literal was incomplete.
        + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
    + FullyQualifiedErrorId : MissingEqualsInHashLiteral

参考:http ://www.i18nqa.com/debug/utf8-debug.html

4

1 回答 1

3
于 2015-03-11T07:53:50.707 回答