in reply to CueCat decoding with Perl - revisited

Hex 1B (decimal 27) is an escape character, and chr hex '5B' is a "[". This looks a lot like Ansi escape sequences to me. You could check out thing like Win32::Console::ANSI to figure out what it represents. For example.

And there are (farily simple) rules to how these escape sequences are constructed, so it is easily possible to use regexes to remove them from your strings.

Replies are listed 'Best First'.
Re^2: CueCat decoding with Perl - revisited
by saintmike (Vicar) on Apr 03, 2005 at 21:26 UTC
    There's some escape sequences involved, but the most puzzling part is that if you compare the output for the two different barcodes, there's no obvious way on how they map.

    By the way, these sequences are even showing up on Windows: Running

    perl -p -e 1
    and operating the barcode reader will also display them, and not the barcode numbers. It's just that applications like Notepad seem to interpret them in a certain way so that they're showing as regular characters within the application.