【发布时间】:2014-12-04 18:38:50
【问题描述】:
我有这个 C# ITF/Interleaved 2 of 5 算法(来自 VB Azalea Software 算法):
public static string Interleaved25(string input)
{
if (input.Length <= 0) return "";
if (input.Length % 2 != 0)
{
input = "0" + input;
}
string result = "";
//Takes pairs of numbers and convert them to chars
for (int i = 0; i <= input.Length - 1; i += 2)
{
int pair = Int32.Parse(input.Substring(i, 2));
if (pair < 90)
pair = pair + 33;
else if (pair == 90)
pair = pair + 182;
else if (pair == 91)
pair = pair + 183;
else if (pair > 91)
pair = pair + 104;
result = result + Convert.ToChar(pair);
}
//Leading and trailing chars.
return (char)171 + result + (char)172;
}
问题在于不知何故chars 和value > 89 结果都是空框(使用 ITF 字体)。
【问题讨论】: