public static string GetCode39Ex(string text) {
string ret = "";
for (int k = 0; k < text.Length; ++k) {
char c = text[k];
if (c > 127)
throw new ArgumentException("The character '" + c + "' is illegal in code 39 extended.");
char c1 = EXTENDED[c * 2];
char c2 = EXTENDED[c * 2 + 1];
if (c1 != ' ')
ret += c1;
ret += c2;
}
return ret;
}