Coder Social home page Coder Social logo

Comments (3)

saknarak avatar saknarak commented on July 3, 2024 1

example code for Thai

const encoder = new EscPosEncoder({
  codepageMapping: {
    cp437: 0x00,
    shiftjis: 0x01,
    cp850: 0x02,
    cp860: 0x03,
    cp863: 0x04,
    cp865: 0x05,
    cp851: 0x0b,
    cp853: 0x0c,
    cp857: 0x0d,
    cp737: 0x0e,
    iso88597: 0x0f,
    windows1252: 0x10,
    cp866: 0x11,
    cp852: 0x12,
    cp858: 0x13,
    cp874: 0x16, // 22, for Thai with EPSON that sold in Thai
    cp720: 0x20,
    cp775: 0x21,
    cp855: 0x22,
    cp861: 0x23,
    cp862: 0x24,
    cp864: 0x25,
    cp869: 0x26,
    iso88592: 0x27,
    iso885915: 0x28,
    cp1098: 0x29,
    cp1118: 0x2a,
    cp1119: 0x2b,
    cp1125: 0x2c,
    windows1250: 0x2d,
    windows1251: 0x2e,
    windows1253: 0x2f,
    windows1254: 0x30,
    windows1255: 0x31,
    windows1256: 0x32,
    windows1257: 0x33,
    windows1258: 0x34,
    rk1048: 0x35,
  },
})

encoder
    .initialize()
    .codepage('cp874')
    .line('ทดสอบภาษาไทย')
    .encode()

from escposencoder.

NielsLeenheer avatar NielsLeenheer commented on July 3, 2024

Whether or not a particular codepage works depends a lot on the model of the printer. Some printers do not support all codepages, and some manufacturers use different codepage mappings. The upcoming version 2 should have better support for different codepage mappings.

Which printer are you using?

from escposencoder.

chukiatt avatar chukiatt commented on July 3, 2024

are you tested.

from escposencoder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.