H hanyelmehy Well-Known Member Licensed User Longtime User Oct 12, 2019 #1 How to convert text from one character encoding to another
Brandsum Well-Known Member Licensed User Oct 12, 2019 #2 Code: Copy Dim str_enc_1 As String = "some text" Dim b() as Byte = str_enc_1.getbytes("iso-8859-1") Dim str_enc_2 As String = BytesToString( b, 0, b.Length, "UTF-8" ) Upvote 0
Code: Copy Dim str_enc_1 As String = "some text" Dim b() as Byte = str_enc_1.getbytes("iso-8859-1") Dim str_enc_2 As String = BytesToString( b, 0, b.Length, "UTF-8" )
H hanyelmehy Well-Known Member Licensed User Longtime User Oct 12, 2019 #3 Brandsum said: Code: Copy Dim str_enc_1 As String = "some text" Dim b() as Byte = str_enc_1.getbytes("iso-8859-1") Dim str_enc_2 As String = BytesToString( b, 0, b.Length, "UTF-8" ) Click to expand... Thank you for your help ,but the problem for me what is the raw encoder used ? for example i want to convert Arabic text (written in B4A Ide) to ISO-8859-6 encoding Main Task is to print on POS Printer with ESC/POS ,i use correct code page for printer for Arabic but its not print correctly Last edited: Oct 12, 2019 Upvote 0
Brandsum said: Code: Copy Dim str_enc_1 As String = "some text" Dim b() as Byte = str_enc_1.getbytes("iso-8859-1") Dim str_enc_2 As String = BytesToString( b, 0, b.Length, "UTF-8" ) Click to expand... Thank you for your help ,but the problem for me what is the raw encoder used ? for example i want to convert Arabic text (written in B4A Ide) to ISO-8859-6 encoding Main Task is to print on POS Printer with ESC/POS ,i use correct code page for printer for Arabic but its not print correctly
DonManfred Expert Licensed User Longtime User Oct 12, 2019 #4 the strings in the ide are encoded in utf-8 per default. just switch the code from @Brandsum. get the utf8 bytes and then convert the bytes to string using iso-8859-6 Upvote 0
the strings in the ide are encoded in utf-8 per default. just switch the code from @Brandsum. get the utf8 bytes and then convert the bytes to string using iso-8859-6