T thanos Member Licensed User Longtime User Jun 16, 2016 #1 Hello. I try to print to a thermal pos printer with opening its port (9100) with a socket and send raw text. Everything is okay with the latin characters. When I print Greek characters i took bad results. Instead of the correct characters i took something like ╢│▓╩ etc. I tried to convert to ISO-8859-1 (which is not totally right because the greek codepage is ISO-8859-7) Code: Copy Dim arrBytes() As Byte Dim sText As String sText = "Ημερομηνία" '- aStream.Write(sText.GetBytes("UTF8")) arrBytes = sText.GetBytes("ISO-8859-1") aStream.Write(arrBytes) but i took almost same results (different characters but bad printing). I send a question to company support, but no answer... The client told that with his windows mobile application this printer is able to print greek characters. For the record the printer is a Custom Kube. Regards.
Hello. I try to print to a thermal pos printer with opening its port (9100) with a socket and send raw text. Everything is okay with the latin characters. When I print Greek characters i took bad results. Instead of the correct characters i took something like ╢│▓╩ etc. I tried to convert to ISO-8859-1 (which is not totally right because the greek codepage is ISO-8859-7) Code: Copy Dim arrBytes() As Byte Dim sText As String sText = "Ημερομηνία" '- aStream.Write(sText.GetBytes("UTF8")) arrBytes = sText.GetBytes("ISO-8859-1") aStream.Write(arrBytes) but i took almost same results (different characters but bad printing). I send a question to company support, but no answer... The client told that with his windows mobile application this printer is able to print greek characters. For the record the printer is a Custom Kube. Regards.
Erel B4X founder Staff member Licensed User Longtime User Jun 16, 2016 #2 All that I can say is that your code is correct. It will send the string with the specified encoding. Maybe the encoding is not correct. Upvote 0
All that I can say is that your code is correct. It will send the string with the specified encoding. Maybe the encoding is not correct.
T thanos Member Licensed User Longtime User Jun 16, 2016 #3 Erel said: All that I can say is that your code is correct. It will send the string with the specified encoding. Maybe the encoding is not correct. Click to expand... @Erel Thanks for the response. The right encoding for Greek is ISO-8859-7 but i am not wrong this is not supported by Android. In any case is there a way to convert the strings into an very very old encoding like IBM737 to try? Regards Upvote 0
Erel said: All that I can say is that your code is correct. It will send the string with the specified encoding. Maybe the encoding is not correct. Click to expand... @Erel Thanks for the response. The right encoding for Greek is ISO-8859-7 but i am not wrong this is not supported by Android. In any case is there a way to convert the strings into an very very old encoding like IBM737 to try? Regards
Erel B4X founder Staff member Licensed User Longtime User Jun 16, 2016 #4 thanos said: The right encoding for Greek is ISO-8859-7 but i am not wrong this is not supported by Android. Click to expand... Try it with different charsets. It will throw an error if the charset is not supported. Upvote 0
thanos said: The right encoding for Greek is ISO-8859-7 but i am not wrong this is not supported by Android. Click to expand... Try it with different charsets. It will throw an error if the charset is not supported.
T thanos Member Licensed User Longtime User Jun 16, 2016 #5 Erel said: Try it with different charsets. It will throw an error if the charset is not supported. Click to expand... @Erel Thanks again. As i saw the company gives an sdk for Android which is a jar file. Can i use it inside B4A without the necessary xml file? Regards Last edited: Jun 17, 2016 Upvote 0
Erel said: Try it with different charsets. It will throw an error if the charset is not supported. Click to expand... @Erel Thanks again. As i saw the company gives an sdk for Android which is a jar file. Can i use it inside B4A without the necessary xml file? Regards
Erel B4X founder Staff member Licensed User Longtime User Jun 17, 2016 #6 You will need to create a wrapper or access it with JavaObject and #AdditionalJar. Upvote 0
T thanos Member Licensed User Longtime User Jun 17, 2016 #7 Erel said: You will need to create a wrapper or access it with JavaObject and #AdditionalJar. Click to expand... How can i create this wrapper? And based on your expertise, which way you suggest me? The wrapper's way or the using the JavaObject (for code readbility, speed etc.)? Regards Upvote 0
Erel said: You will need to create a wrapper or access it with JavaObject and #AdditionalJar. Click to expand... How can i create this wrapper? And based on your expertise, which way you suggest me? The wrapper's way or the using the JavaObject (for code readbility, speed etc.)? Regards
Erel B4X founder Staff member Licensed User Longtime User Jun 19, 2016 #8 See the tutorials here: https://www.b4x.com/android/forum/forums/libraries-developers-questions.32/ The performance is the same. If the library is simple enough, and you never created a wrapper before then it will be simpler to use JavaObject. Accesing third party Jar with #Additionaljar and JavaObject Upvote 0
See the tutorials here: https://www.b4x.com/android/forum/forums/libraries-developers-questions.32/ The performance is the same. If the library is simple enough, and you never created a wrapper before then it will be simpler to use JavaObject. Accesing third party Jar with #Additionaljar and JavaObject