diff --git a/src/Mike42/Escpos/ChineseEncoding.php b/src/Mike42/Escpos/ChineseEncoding.php new file mode 100644 index 00000000..eea73e26 --- /dev/null +++ b/src/Mike42/Escpos/ChineseEncoding.php @@ -0,0 +1,16 @@ + connector -> write(self::FS . "&"); - $str = \UConverter::transcode($str, "GBK", "UTF-8"); + $str = \UConverter::transcode($str, $encoding -> value, "UTF-8"); $this -> buffer -> writeTextRaw((string)$str); $this -> connector -> write(self::FS . "."); }