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

Japanese Character Print #31

Closed
ghost opened this issue Jul 19, 2020 · 9 comments
Closed

Japanese Character Print #31

ghost opened this issue Jul 19, 2020 · 9 comments

Comments

@ghost
Copy link

ghost commented Jul 19, 2020

@DantSu

Hi,
This is my second issue.
I need to print Japanese characters.
My printer can support Japanese characters and has the same codepage as EPSON.
I tried many different variations but I was unable to print simple Japanese characters.
Can you please give me some suggestions?
How should I write the EscPosCharsetEncoding function?
Thank you.

@DantSu
Copy link
Owner

DantSu commented Jul 20, 2020

My printer have this id for charsets :
20200623_151000

Here is charset id for an Epson printer :
https://www.epson-biz.com/modules/ref_escpos/index.php?content_id=32

You have to find the correct charset for Japanese char for your printer. I can't help you more.

@ghost
Copy link
Author

ghost commented Jul 20, 2020

@DantSu

Thank you so much for replying.

I understood the codepage thing a little bit. I have mailed my printer company for the printer's codepage. They usually reply very fast. When I get the codepage, I will try again. I might have some questions that I want to ask you. That's why I am not closing this issue for now. Is it okay to do?

Thank you.

@DantSu
Copy link
Owner

DantSu commented Jul 20, 2020

Yes, keep open this issue. Say me when all is done.

@ghost
Copy link
Author

ghost commented Jul 20, 2020

@DantSu

Thank you so much.

I have got my printer's Codepage list.

image0

I want to print all kinds of Japanese characters consists of Hiragana, Katakana & kanji.
Now how should I write the EscPosCharsetEncoding function?

I have tried the below code but it still doesn't work
EscPosPrinter printer = new EscPosPrinter(new TcpConnection("192.168.1.5", 9100), 203, 80f, 48, new EscPosCharsetEncoding("Shift_JIS", 1));

@DantSu
Copy link
Owner

DantSu commented Jul 20, 2020

x-IBM942 | Cp942 | ibm-942 cp942 ibm942 942 | IBM OS/2 Japanese, superset of Cp932

Try this :

new EscPosCharsetEncoding("x-IBM942", 1)
new EscPosCharsetEncoding("x-IBM942", 29)

May be that will work

@ghost
Copy link
Author

ghost commented Jul 20, 2020

@DantSu

It didn't work :( :(

I also tried other things like
IBM942
ibm-942
ibm942
IBM943

This also Doesn't work.

English characters are printing fine but Katakana characters are printing garbage values.
Are there any other suggestions?

@DantSu
Copy link
Owner

DantSu commented Jul 20, 2020

new EscPosCharsetEncoding("IBM290", 1)
new EscPosCharsetEncoding("IBM290", 29)
new EscPosCharsetEncoding("JIS_X0201", 1)
new EscPosCharsetEncoding("JIS_X0201", 29)
new EscPosCharsetEncoding("x-IBM930", 1)
new EscPosCharsetEncoding("x-IBM930", 29)

I haven't more options after that.

https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html

@ghost
Copy link
Author

ghost commented Jul 20, 2020

@DantSu

Thank you so much for the references.
I couldn't get it to work properly.

I am trying to solve the Unicode problem by using HTML 2 image. And then printing that image.

Reference - HTML2Image_ESC_POS

Thanks a lot for your time and support. :)

@krispusis1991
Copy link

excuse me i want to print thai language
How it works
EscPosCharsetEncoding("?", ?)

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants