Italian testo in lingua bandladesh

giannimaione

Well-Known Member
Licensed User
Longtime User
invio una stringa in italiano su una stampante recipt
B4X:
        OutputStream1.WriteBytes(dataToSend.GetBytes("UTF8"), 0, dataToSend.Length)
se il testo stringa è in bangladesh, il testo viene interpretato in modo errato dalla stampante
quale UTF usre?
 

LucaMs

Expert
Licensed User
Longtime User
1713442180893.png
 

giannimaione

Well-Known Member
Licensed User
Longtime User
grazie @LucaMs per il tuo interesse, ma andiamoci piano con chatgpt ;);

il testo da stampare è tipo "বাংলাদেশী ভাষায় পাঠ্যের উদাহরণ"

il codice di stampa è
B4X:
Dim OutputStream1 As OutputStream
OutputStream1 = socket1.OutputStream
Dim dataToSend As String = "বাংলাদেশী ভাষায় পাঠ্যের উদাহরণ"
OutputStream1.WriteBytes(dataToSend.GetBytes("UTF8"), 0, dataToSend.Length)
Sleep (500)
OutputStream1.Close
ma il risultato non è corretto;

al momento non ho una foto/immagine della stampa (scontrino), penso settimana prossima di eseguire nuove verifiche;

forse il problema è la stampante?
forse c'è da configurare un font/CodePage ?

provo con una email al servizio tecnico del produttore della stampante
 

giannimaione

Well-Known Member
Licensed User
Longtime User
da un post di "stack Overflow"
First of all please check the printer has bangla font support. if not then another way you can print. you need to capture the layout which has the bangla text as image (bitmap) then use the printers bitmap printing api. I had the same problem for arabic text. i solve this problem using this technique. thanks
 

emexes

Expert
Licensed User
da un post di "stack Overflow"
Mi hai preceduto. 🙃

প্রিন্টার কি বাংলাদেশ ভাষার অক্ষর সমর্থন করে?

আপনার সেরা সমাধান সম্ভবত একটি ইমেজ বিটম্যাপে টেক্সট লিখুন, এবং তারপর সেই ইমেজ বিটম্যাপ মুদ্রণ করুন।

https://translate.google.com/?sl=bn&tl=it&text=প্রিন্টার--রুন।&op=translate
 

emexes

Expert
Licensed User
Yikes. Stavo pensando che forse si potrebbe caricare un font personalizzato sulla stampante, ma ora penso che il linguaggio sia troppo intricato perché questa soluzione funzioni.

https://it.wikipedia.org/wiki/Alfabeto_bengalese / https://en.wikipedia.org/wiki/Bengali_alphabet

Il piano di backup sarebbe quello di scrivere una Sub che prenda una String Unicode B4X di testo del Bangladesh, la scriva in una bitmap di immagine binaria in bianco e nero della stessa larghezza della stampante e poi invii l'immagine alla stampante.
 
Top