ipp icon indicating copy to clipboard operation
ipp copied to clipboard

When the data contain Chinese characters, the printed result is garbled

Open AlexZhouAA opened this issue 10 years ago • 3 comments


var printer = ipp.Printer("http://192.168.0.123:631/lp1", {version:"1.0"});
    var msg = {
        "operation-attributes-tag": {
            "requesting-user-name": "William",
            "job-name": "My Test Job",
            "document-format": "text/plain"
        },
        data: new Buffer("中文内容 will be garbled", "utf-8")
    };
    printer.execute("Print-Job", msg, function(err, res){
        console.log(err);
        console.log(res);
    });

If data like above contains Chinese characters, the printed result will be garbled. Please Help.

AlexZhouAA avatar Oct 15 '15 03:10 AlexZhouAA

I don't have using the print language attributes, so- I'm not 100% sure on this... but:

The operation-attributes-tag section has some defaults you can mess with:

  • "attributes-natural-language" (defualt en-us)
  • "attributes-charset" (default utf-8... you should be ok here)

Let me know if you get this working. I wish I had more suggestions.

williamkapke avatar Oct 17 '15 05:10 williamkapke

did u solve that?

Holy-Fak avatar Nov 13 '20 06:11 Holy-Fak

I'm having the same problem. Did you find a solution?

simaybocu avatar May 20 '22 09:05 simaybocu