mirror of
https://github.com/fralx/LimeReport.git
synced 2025-10-02 19:56:58 +03:00
Update Zint
This commit is contained in:
25
3rdparty/zint-2.10.0/backend/tools/cnv_gb2312.php
vendored
Normal file
25
3rdparty/zint-2.10.0/backend/tools/cnv_gb2312.php
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/* Convert libiconv-1.16/lib/gb2312.h to EUC-CN values (+ 0x8080). */
|
||||
/*
|
||||
libzint - the open source barcode library
|
||||
Copyright (C) 2008-2019 Robin Stuart <rstuart114@gmail.com>
|
||||
*/
|
||||
/* vim: set ts=4 sw=4 et : */
|
||||
|
||||
$in = false;
|
||||
while ($line = fgets(STDIN)) {
|
||||
if ($in) {
|
||||
if (strncmp($line, '};', 2) === 0) {
|
||||
echo $line;
|
||||
break;
|
||||
}
|
||||
echo preg_replace_callback('/0x([0-9a-f]{4})/', function ($matches) {
|
||||
return '0x' . dechex(hexdec($matches[1]) + 0x8080);
|
||||
}, $line);
|
||||
} else {
|
||||
if (strpos($line, 'short gb2312_2charset') !== false) {
|
||||
echo $line;
|
||||
$in = true;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user