januslo / react-native-bluetooth-escpos-printer

React-Native plugin for the bluetooth ESC/POS & TSC printers.
MIT License
361 stars 420 forks source link

Encoding UTF-8 #8

Closed tranhung148 closed 5 years ago

tranhung148 commented 5 years ago

I need print some text with encoding UTF-8. Seem this library does not support UTF-8. Is it right?

januslo commented 5 years ago

What language you are working with? I have tested English and some Chinese, Both works fine except ¥ siymb

发自我的 iPhone

在 2018年12月19日,下午5:19,tranhung148 notifications@github.com 写道:

I need print some text with encoding UTF-8. Seem this library does not support UTF-8. Is it right?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

januslo commented 5 years ago

here is a sample: alt

tranhung148 commented 5 years ago

i am using vietnamese. I need write some words: ư, ơ, ă, â, ứ, ớ, ở, ô, .... In this below example, i am trying write text: "Người". But receive this result. 48377897_320304195488746_6057643520913571840_n

tranhung148 commented 5 years ago

i was try pass param encoding "UTF-8" but didn't receive my expect

januslo commented 5 years ago

May i know what codeset your printer supports. I encode the bytes by GBK currently. My devices would cause issue while using UTF-8.

januslo commented 5 years ago

I found something shows UTF-8 would not resolve vietnamese problem neither.

https://stackoverflow.com/questions/53099808/convert-text-to-latin-encoding-and-decode-back-problem-for-vietnamese

It need some codding test for vietnamese but I cannot spare my time to it now.

guihendias commented 5 years ago

Hey, is there a encoding where I can use the dolar sign? I'm from brazil, utf-8 really isn't working as expected.

Any thoughts on how can I proceed? I need to print phrases like "Preço R$ 5,00" and it prints "Pre?o R¥ 5,00" on encodings I've tried.

thankssss

gdierksmeier commented 5 years ago

You can play with SelfText and see if your printer accept the Portuguese....(codepage) BluetoothEscposPrinter.printText( "Preço", { encoding: 'Cp037', codepage: 3, widthtimes: 0, heigthtimes: 0, fonttype: 1 } ); You can find encoding here: https://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html

Boa sorte.

gdierksmeier commented 5 years ago

20190129_084039 1

gdierksmeier commented 5 years ago

Try this

BluetoothEscposPrinter.printText( "İŞÖÇİşiçöğü awd awdawdaad --**? \r\n", {
  encoding: 'Cp1254',
  codepage: 22,
  widthtimes: 0,
  heigthtimes: 0,
  fonttype: 1
} );

Other options: Cp857, Cp1256, Cp1026

canerd7u commented 5 years ago

@gdierksmeier thanks bro. İm using codepage 32 with encoding Cp1254. Now working all turkish characters.

KBepo commented 5 years ago

Hello, didn't want to make new issue ticket so I'll just ask here. Which encoding should I use for Croatian lagnuage? We are using latinic letters with addition of ć,č,š,ž and đ.

As others mentioned UTF8 or UTF-8 for encoding doesn't seem to work.

Or if you could point me to all the encodings supported so I can test them till I find suitable one.

Best regards, Bepo.

vgvishal538 commented 5 years ago

Hello @gdierksmeier can you please tell me which encoding i should use for printing Indian (Hindi ) language?

gdierksmeier commented 5 years ago

Sorry @vgvishal538 i have no experience with hindi....seems the solution is convert and print an image...
https://stackoverflow.com/questions/36645996/how-to-display-hindi-or-gujarati-font-using-bluetooth-printer

Iamstanlee commented 5 years ago

hello , which encoding should i use for printing Arabic text ?

anyone ? please.

gdierksmeier commented 5 years ago

We are using: ENCODING: ISO8859_6 CODEPAGE: 22

All depend of your printer...try also the combinations: "encoding": "Cp1256" or "encoding":" Cp864" with CODEPAGE: 22 or 32

mg4u commented 5 years ago

@Iamstanlee did you get the Arabic encoding?

mg4u commented 5 years ago

The best solution I find out is, Build your receipt in View component and style it as you like, do not forget to make the background of the view "white", and use "react-native-view-shot" to convert the view to an image then printPic by Bluetooth printer. Hope this helps.

alimasarra commented 5 years ago

hi, its printing arabic, but its printing it in the inverse way, like: علي مسرة its printing it ةرسم يلع any solution for that? and i am using these ENCODING: ISO8859_6 CODEPAGE: 22

alimasarra commented 5 years ago

fixed it by adding this.reverseString before the text

mg4u commented 5 years ago

@alimasarra could you add snippet code?

aeolus commented 5 years ago

Need some help with Swedish, anyone got lucky?

januslo commented 5 years ago

Have you try to check the codepage information?

发自我的 iPhone

在 2019年5月2日,上午5:11,Chengwei Ding notifications@github.com 写道:

Need some help with Swedish, anyone got lucky?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

datvp09 commented 5 years ago

BluetoothEscposPrinter.printText("Tiếng việt nè đm chúng m\n\n", {encoding: 'Cp1258',codepage:30});

@gdierksmeier I found Cp1258 and codepage 30 nearly display Vietnamese characters, are there any option? my device is Mini thermal printer 5802DD

quy1403 commented 5 years ago

@datvp09 máy in của e là Apos P100, e thử Cp1258 and codepage 30 như bác mà k in đc TV, có cách nào dò ra đc encoding và codepage chuẩn cho máy in của e k bác, thanks uuu

datvp09 commented 5 years ago

@quy1403 e tìm xem có file pdf guide của máy k, tìm đến phần text code gì đó có list ra 1 loạt encoding rồi từ đó thử codepage

quy1403 commented 5 years ago

@datvp09 e k tìm đc pdf guide, giờ k biết encoding vs codepage như nào, của a in tiếng việt ngon lành chứ, e đang có 2 máy xprinter và Apos ở đay mà loay hoay ko in đc, à cho e xin Skype có gì chat trao đổ

quy1403 commented 5 years ago

@billdoorsvn
e thử in 1 cái ảnh thì thấy tốc độ in khá trậm, vs có vẻ khá tốn mực, chứ k vèo vèo như in text a ơi, có cách nào in nhanh như in text k ạ

datvp09 commented 5 years ago

máy in nhiệt thì làm gì có mực :v bên mình dùng sunmi printer r, có thư viện hỗ trợ luôn cho khỏe

quy1403 commented 5 years ago

@tranhung148 sao lại close thế a ơi, vẫn chưa đc giải quyết mà a

quy1403 commented 5 years ago

@datvp09 a có skype ko cho e xin với , e hỏi a trực tiếp cho rõ khoản in ấn này ạ, help me please

PhamMinhKha commented 5 years ago

Làm sau in được tiếng việt vậy bác @tranhung148

shubhamdeol commented 5 years ago

Hello @gdierksmeier can you please tell me which encoding i should use for printing Indian (Hindi ) language?

@vgvishal538 Have you found any encoding for hindi?

huuanh021287 commented 4 years ago

Hello. I have problem printer vietnamese. Can you help me?

await BluetoothEscposPrinter.printText('Tiếng Việt \r\n\r\n\r\n', { encoding: 'GBK', codepage: 32, // 27 or 22 or 30. widthtimes: 0, heigthtimes: 0, fonttype: 0, });

Thanks

aroumane commented 3 years ago

Hello, For the euro sign the configuration is this:

{
encoding:' Cp858',
codepage: 13
}

for the French language

shushi1506 commented 3 years ago

@quy1403 a đã tìm ra cách in tiếng việt trên con apos p100 chưa ạ, giúp em với

tranhung148 commented 3 years ago

Không in được tiếng việt có dấu đâu.

Vào 15:24, T.3, 29 Th6, 2021 Bui Tuan Anh @.***> đã viết:

@quy1403 https://github.com/quy1403 a đã tìm ra cách in tiếng việt trên con apos p100 chưa ạ, giúp em với

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/januslo/react-native-bluetooth-escpos-printer/issues/8#issuecomment-870387853, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD5LEZ27UGV4VHPDI36Z3WTTVF7L5ANCNFSM4GLHKTAQ .

NguyenThanhNhuJS99 commented 3 years ago

Làm sau in được tiếng việt vậy bác @tranhung148

@datvp09 e k tìm đc pdf guide, giờ k biết encoding vs codepage như nào, của a in tiếng việt ngon lành chứ, e đang có 2 máy xprinter và Apos ở đay mà loay hoay ko in đc, à cho e xin Skype có gì chat trao đổ

Ra chưa anh ơi, em cũng đang dùng con xprinter ạ. Cứu em với :))

PhamMinhKha commented 3 years ago

Chuyển thứ cần in sang image rồi in ra kiểu image là được. Nhược điểm là máy in sẽ in lâu hơn nhưng được cái tiếng việt

NguyenThanhNhuJS99 commented 3 years ago

Chuyển thứ cần in sang image rồi in ra kiểu image là được. Nhược điểm là máy in sẽ in lâu hơn nhưng được cái tiếng việt

Cảm ơn anh ạ

NguyenThanhNhuJS99 commented 3 years ago

Chuyển thứ cần in sang image rồi in ra kiểu image là được. Nhược điểm là máy in sẽ in lâu hơn nhưng được cái tiếng việt

À anh dùng thư viện gì để chuyển sang image vậy ạ, tks anh

shushi1506 commented 3 years ago

Máy nào có hỗ trợ tiếng việt thì in được, mình thử 4, 5 con có một con không hỗ trợ, k tài nào in được, chuyển sang image thì có tiếng việt nhưng siêu chậm

Vào Th 4, 21 thg 7, 2021 vào lúc 14:12 NguyenThanhNhuJS99 < @.***> đã viết:

Chuyển thứ cần in sang image rồi in ra kiểu image là được. Nhược điểm là máy in sẽ in lâu hơn nhưng được cái tiếng việt

À anh dùng thư viện gì để chuyển sang image vậy ạ, tks anh

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/januslo/react-native-bluetooth-escpos-printer/issues/8#issuecomment-883949581, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF2QJ66EULT2LND3NLGDFPTTYZXOHANCNFSM4GLHKTAQ .

DDS-VangTA commented 2 years ago

Chuyển thứ cần in sang image rồi in ra kiểu image là được. Nhược điểm là máy in sẽ in lâu hơn nhưng được cái tiếng việt

À anh dùng thư viện gì để chuyển sang image vậy ạ, tks anh

Load 1 bitmap từ local( nền trắng). Draw text lên bitmap image đó rồi in ra

DDS-VangTA commented 2 years ago

i was try pass param encoding "UTF-8" but didn't receive my expect

@tranhung148 anh đã in được tiếng Việt chưa ạ. Cho e giải pháp với

d6mobile commented 1 year ago

e cũng đang gặp vấn đề trên iOS. ko tìm đc encoding hỗ trợ tiếng việt. mn chỉ e với. may xprint (cắm máy tinh in blue thì có hỗ trợ tiếng việt)

huuanh1987 commented 1 year ago

BluetoothEscposPrinter.printText("Tiếng việt nè đm chúng m\n\n", {encoding: 'Cp1258',codepage:30});

@gdierksmeier I found Cp1258 and codepage 30 nearly display Vietnamese characters, are there any option? my device is Mini thermal printer 5802DD

@d6mobile Bác dùng cách này thử xem. Còn k thì in bằng image thôi, hơi chuối thật.

haphanquang commented 11 months ago

mọi người có giải pháp chưa vậy, em đang cần in trên iOS? nếu dùng image thì chậm quá, chỉ còn các bỏ dấu rồi in ra nhưng như vậy thì không ổn tí nào.

Kunjvr1223 commented 4 months ago

Hello @vgvishal538 Have You Found Any Encoding That Print Indian Languages ? Please Tell Me.

snowinrain commented 2 months ago

I have a generic solution to print any language, including Vietnamese. It's not perfect but will work definitely. 1) You need to find code page that support your language. E.g.: 27, 30, 31, 32 are known Code Page for Vietnamese. 2) Encoding your text with correct encoder. E.g: TCVN-3 is correct one for Vietnamese. Please refer to this link for more detail.