Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTF8 support #4

Open
devfelipereis opened this issue Feb 16, 2018 · 3 comments
Open

UTF8 support #4

devfelipereis opened this issue Feb 16, 2018 · 3 comments

Comments

@devfelipereis
Copy link

Hello! Thanks for this great project.

I need to use characters like "ç", "é", etc... When I print with that, I get something like "chinese" characters.

Is it possible with this lib? Or is this a limitation of my printer(I'm testing in a "Kinup KP-1019")?
Obs: I'm new with this.

Thank you!

@ingoncalves
Copy link
Owner

I'm thankful for your contribution.

Well, I'm not sure that the cause is the lib or the printer. But, you can figure out it, by a simple test.
The BufferBuilder uses the ascii encode, but you can change it to utf8 and test if it works.

public printText(text: string): BufferBuilder {
this.buffer.write(text, 'ascii');
return this;
}

Bibliography: https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings

@ingoncalves
Copy link
Owner

I tested printing a text "ç" and "õ" with utf8 encoding, but the printer was not able to print it correctly, printing a chinese character instead.

@devfelipereis
Copy link
Author

Hello. Thanks for the instructions.

Ten minutes ago I was also testing.
Not working for me either.
I have the same result as you.

lakshmaji-till pushed a commit to lakshmaji-till/escpos-xml that referenced this issue Apr 22, 2021
Replace handlebars with mustache and public npm package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants