Open Gunasekaran15 opened 6 years ago
is your code using utf-8 encoding too?
without utf-8 it prints symbols,with utf-8 it print like in the above image
I'm not sure it will help but i think your .js files must be utf-8 aswell so it matches the encoding you are passing to the datecs plugin. In atom you should be able to find your file encoding at the footer (see image)
Yes it is utf-8.
I think the plug in function change the characters to symbols,I also try to print chinese characters using their encoding standard GB 18030 but it prints symbols.Is there any way to print what we give in the printText function that print that exact text without using encoding and any other methods
This plugins uses the api method that passes a charset encoding, using the ISO-8859-1 as default.
You could edit the plugin so it uses the method that doesn't pass the charset. It will use a default encoding (maybe the system default?). As it is in the api's documentation:
public void printTaggedText(java.lang.String s) throws java.io.IOException
Prints a tagged text using default charset for encoding. The text is encode into a sequence of bytes using the default charset encoding.
the plugin file that uses the overriden method (public void printTaggedText(java.lang.String s, java.lang.String encoding) is at cordova-plugin-datecs-printer\src\android\DatecsPrinter.java line 76.
But we change the charset and that data sent to the printer using window.DatecsPrinter.printText('text','charset'). I change the charset as utf8 in this method.
If we change the charset as utf8 default.It prints what we give in printText() method or not.
it only uses ISO-8859-1 if you dont specify what charset you want (eg: printText('text');)
If we specify the particular charset it takes that charset or not.
why we can't change that particular charset as UTF-8.
Yes. The plugin is using the following Datecs API method:
public void printTaggedText(java.lang.String s, java.lang.String encoding) throws java.io.IOException
Prints a tagged text using the named charset for encoding. The text is encode into a sequence of bytes using the given charset. If s if null, a NullPointerException is thrown. Parameters: s - the tagged text to print. encoding - the name of a supported charset.
Please provide the guideline to change supported charset to print tamil language.
So i tried printing those characteres here too but didn't work. I guess you should email Datecs asking which charsets are supported since it goes straight to their api.
I am also facing the issues on tamil characters..i m getting like this ?????????..anyone find the solution for tamil language.
Any solution?
try to convert hex decimal values into byte array its working for tamil printing but styles are not supported ...
trigger a printer self test, it should trigger a printing of current printer's detail showing which codepage been set.
If the current codepage doesn't support the character you want to print, you need to find the relevant printer's setting tool to set the codepage first. you may do so by start looking at the printer manufacturer's website download page.
How to print Tamil Characters using this plugin methods,Please Provide the method name and examples to print this characters.sample copy of printed data
my code for printing tamil char:
var a='தமிழ் மேல் ஆர்வமுடையவர்கள் தாங்கள் விரும்பும் தலைப்புகளில் கட்டுரைகளை எழுதி எழுத்து.காம் ல் சமர்பிக்கலாம்'; window.DatecsPrinter.write(a,'UTF-8',
Plese provide the solution for this as soon as possible.