3 ms·
> The £ is printed just fine on some parts of the receipt! > ⨈Һ𝘢ʈ ╤ћᘓ 𝔽ᵁʗꗪ Assuming the printer uses ESC/POS[0] (which is likely), the codepage is part of t
by masklinn 9y ago
> The £ is printed just fine on some parts of the receipt!
> ⨈Һ𝘢ʈ ╤ћᘓ 𝔽ᵁʗꗪ
Assuming the printer uses ESC/POS[0] (which is likely), the codepage is part of the printer's state. To change the code page, the driver sends a specific ESC command (<ESC t x> aka <1B 74 XX> where x/XX is the desired codepage byte) (none of which is "UTF8" incidentally) and you can change the codepage before each actually displayed character.
So it's the driver software fucking up and either misencoding its content (most likely) or selecting the wrong codepage. The £ might be displayed correctly on the right side because it's e.g. hard-coded (properly encoded) while the product label is dynamic and when that was added/changed no care was taken with respect to properly transcoding. The printer absolutely doesn't care, it just maps a byte to a glyph according to the currently selected codepage.
[0] ESC because the protocol is based on proprietary ESCape codes[1], POS because the entire thing's a giant piece of shit
[1] https://en.wikipedia.org/wiki/Escape_character#ASCII_escape_character https://en.wikipedia.org/wiki/Escape_character#ASCII_escape_...
- tonyedgecombe 9y agoThirty five years ago I started working for a company that made label printers and one of the common technical issues I had to deal with was pound signs not printing. It's quite funny that we still have the same issues after all that time.
- tragomaskhalos 9y agoOtoh twenty-seven years ago I spent a lot of time messing around with termcap and/or terminfo on various customer sites trying to get their terminals to display something other than gibberish. That's no longer really a thing, thank god, although I wryly note that there is, inevitably, a relevant O'Reilly book that I would have sold my grandmother for had I known about it.
- heywire 9y agoAlternatively, they might have received their item file from a system which bungled the encoding. Source: POS system developer
- craigds 9y ago> none of which is "UTF8" incidentally Why not? Shouldn't all printers made nowadays support UTF8? Probably by default?
- mjevans 9y agoBackward compatibility. It will refuse to die /forever/.
- masklinn 9y agoAlso simplicity (for the printer vendor), codepages means you just take your input byte and index into an array, UTF8 means you need to implement UTF-8 decoding (which is simple but not free and now you need to deal with decoding errors) and automatic check/swap of your raster maps in the printer. This is all logic which codepages foist onto the driver developer.
- eridius 9y agoDealing with decoding errors is simple, you just substitute U+FFFD any time you hit one.
- na85 9y agoSadly, my Oneplus 3T rendered the A and the F of your "what the fuck" as black boxes. Mind boggling that this is still a problem today.
- boomboomsubban 9y agoI believe that means it's correctly interpreting the Unicode, but there isn't a font that contains a character for that code. I think this is because the "official" Android font is patented, another layer of absurd crap that leads to many Unicode issues.
- Yizahi 9y agoOn my OP3T it is fine in Chrome and two squares in Firefox.