java.nio.charset.UnsupportedCharsetException: x-IBM737
at java.nio.charset.Charset.forName(Charset.java:303)
at anywheresoftware.b4a.objects.streams.File$TextWriterWrapper.Initialize2(File.java:482)
at bt.spp.printing.main._printer_connected(main.java:504)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
at anywheresoftware.b4a.BA$3.run(BA.java:332)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:5365)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
at dalvik.system.NativeStart.main(Native Method)
java.nio.charset.UnsupportedCharsetException: x-IBM737
Probably not.Are these all?
Sub GetAvalableCharsets
Dim jo As JavaObject
Dim CharSets As Map
jo.InitializeStatic("java.nio.charset.Charset")
Dim jo1 As JavaObject
jo1.InitializeStatic("java.util.SortedMap")
jo1 = jo.RunMethod("availableCharsets", Null)
Dim size As Int
size = jo1.RunMethod("size", Null)
Dim jo2 As JavaObject
jo2.InitializeStatic("java.util.Set")
jo2 = jo1.RunMethod("keySet", Null)
Dim obj(size) As Object
obj = jo2.RunMethod("toArray", Null)
For i = 0 To size - 1
Log(obj(i))
Next
End Sub
Adobe-Standard-Encoding
Big5
Big5-HKSCS
BOCU-1
CESU-8
cp1363
cp851
cp864
EUC-JP
EUC-KR
GB18030
GBK
hp-roman8
HZ-GB-2312
IBM-Thai
IBM00858
IBM01140
IBM01141
IBM01142
IBM01143
IBM01144
IBM01145
IBM01146
IBM01148
IBM01149
IBM037
IBM1047
IBM280
IBM290
IBM424
ISO-2022-CN-EXT
ISO-2022-KR
ISO-8859-13
KOI8-R
Shift_JIS
UTF-16LE
UTF-32
UTF-32BE
UTF-32LE
UTF-7
UTF-8
windows-1250
windows-1251
windows-1252
windows-1253
windows-1254
windows-1255
windows-1256
windows-1257
windows-1258
x-compound-text
x-docomo-shift_jis-2012
x-ebcdic-xml-us
x-gsm-03.38-2000
x-ibm-1255_P100-1995
x-ibm-1256_P110-1997
x-ibm-1257_P100-1995
x-ibm-1258_P100-1997
x-ibm-12712-s390
x-ibm-12712_P100-1998
x-ibm-1386_P100-2001
x-ibm-16684_P110-2003
x-ibm-16804-s390
x-ibm-16804_X110-1999
x-ibm-25546
x-ibm-33722_P12A_P12A-2009_U2
x-ibm-37-s390
x-ibm-4517_P100-2005
x-ibm-4899_P100-1998
x-ibm-4909_P100-1999
x-ibm-4971_P100-1999
x-ibm-5123_P100-1999
x-ibm-5351_P100-1998
x-ibm-5478_P100-1995
x-ibm-9067_X100-2005
x-IBM1153
x-IBM930
x-IBM933
x-IBM935
x-IBM937
x-IBM939
x-IBM942
x-IBM943
x-IBM949
x-IBM949C
x-IBM950
x-IBM954
x-IBM964
x-IBM970
x-IBM971
x-IMAP-mailbox-name
x-iscii-be
x-iscii-gu
x-iscii-ka
x-iscii-ma
x-iscii-or
x-iscii-pa
x-iscii-ta
x-iscii-te
x-ISCII91
x-ISO-2022-CN-CNS
x-iso-8859-11
x-JavaUnicode
x-JavaUnicode2
x-JIS7
x-JIS8
x-kddi-shift_jis-2012
x-LMBCS-1
x-mac-cyrillic
x-mac-greek
x-MS950-HKSCS
x-UnicodeBig
x-UTF-16LE-BOM
x-UTF16_OppositeEndian
x-UTF32_OppositeEndian
Probably not.
The ones I posted are the ones I knew of.
In the Android documentaion the list is even smaller, but it specifies the garantied Charsets.
I Googled a bit and found this site List of Supported Character Encodings in Java.
Then I looked at the Android documentaion and wrote this code to get the avalable Charsets:
On my Sony xperia z1 the list looks like this:B4X:Sub GetAvalableCharsets Dim jo As JavaObject Dim CharSets As Map jo.InitializeStatic("java.nio.charset.Charset") Dim jo1 As JavaObject jo1.InitializeStatic("java.util.SortedMap") jo1 = jo.RunMethod("availableCharsets", Null) Dim size As Int size = jo1.RunMethod("size", Null) Dim jo2 As JavaObject jo2.InitializeStatic("java.util.Set") jo2 = jo1.RunMethod("keySet", Null) Dim obj(size) As Object obj = jo2.RunMethod("toArray", Null) For i = 0 To size - 1 Log(obj(i)) Next End Sub
printer.Initialize2(cmp20.OutputStream,"x-JavaUnicode")
Case t.CharAt(i)="Π"
Text2Return=Text2Return& Chr(143)
Solved changing encoding just when the euro sign is needed and then back to Greek for the rest characters.What Charset does the printer expect ?
Have you tried windows-1251 ? There the € character is Chr(136).