Merge pull request #27 from skylook/master

* Fix Code 93 escapes above %F :
This commit is contained in:
Benjamin Dobell 2015-08-17 19:46:04 +10:00
commit a0def19ddb

View File

@ -239,16 +239,26 @@ Ref<String> Code93Reader::decodeExtended(string const& encoded) {
throw FormatException::getFormatInstance(); throw FormatException::getFormatInstance();
} }
break; break;
case 'b': case 'b':
// %A to %E map to control codes ESC to US if (next >= 'A' && next <= 'E') {
if (next >= 'A' && next <= 'E') { // %A to %E map to control codes ESC to USep
decodedChar = (char) (next - 38); decodedChar = (char) (next - 38);
} else if (next >= 'F' && next <= 'W') { } else if (next >= 'F' && next <= 'J') {
decodedChar = (char) (next - 11); // %F to %J map to ; < = > ?
} else { decodedChar = (char) (next - 11);
throw FormatException::getFormatInstance(); } else if (next >= 'K' && next <= 'O') {
} // %K to %O map to [ \ ] ^ _
break; decodedChar = (char) (next + 16);
} else if (next >= 'P' && next <= 'S') {
// %P to %S map to { | } ~
decodedChar = (char) (next + 43);
} else if (next >= 'T' && next <= 'Z') {
// %T to %Z all map to DEL (127)
decodedChar = 127;
} else {
throw FormatException::getFormatInstance();
}
break;
case 'c': case 'c':
// /A to /O map to ! to , and /Z maps to : // /A to /O map to ! to , and /Z maps to :
if (next >= 'A' && next <= 'O') { if (next >= 'A' && next <= 'O') {