class Barcode39 {
/** Converts the extended text into a normal, escaped text,
* ready to generate bars.
* @param text the extended text
* @return the escaped text
*/
public static String getCode39Ex(String text) {
StringBuilder out = new StringBuilder("");
for (int k = 0; k < text.length(); ++k) {
char c = text.charAt(k);
if (c > 127)
throw new IllegalArgumentException(MessageLocalization.getComposedMessage("the.character.1.is.illegal.in.code.39.extended", c));
char c1 = EXTENDED.charAt(c * 2);
char c2 = EXTENDED.charAt(c * 2 + 1);
if (c1 != ' ')
out.append(c1);
out.append(c2);
}
return out.toString();
}
}