This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Copyright (c) 2021 Karol Babioch <[email protected]> | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ZBarCharsetDetectionFixer { | |
private static final CharsetDecoder latin1CharsetDecoder = Charset.forName("ISO-8859-1").newDecoder(); | |
private static final CharsetEncoder sjisCharsetEncoder = Charset.forName("SJIS").newEncoder(); | |
/** | |
* Tries to workaround ZBars unreliable charset detection for qr codes. | |
* | |
* What it does: | |
* Encodes String to Shift-JS, decodes the resulting bytes to ISO-8859-1. | |
* |