Cyrillic characters in Browser print are not showing correctly.

When I try to print some cyrillic characters in a label they do not appear correctly. Is there any special thing that I should do to pass the cyrillic characters to the zebra printer through Browser print?

My code:

//setting the priners 
var barcode = "123456789";
var product_name = "Тестов продкт";
var product_price = "2.93 лв."
var zpl = "^XA^CWT,E:ARI000.FNT^CFT,20,20^CI28^BY2,3,57^FT20,170^BCN,,Y,N^FD" + barcode + "^FS^FO20,50^FB370,2^FWn^FH^FD" + product_name + "^FS^FT390,40^FWr^FH^FD" + product_price + "лв^FS^PQ1,0,1,Y^XZ";
var stockReceiptPrinter = null;
var barcodePrinter = null;
$(document).on('ready', function () {  
     BrowserPrint.getLocalDevices(function (result) {       
          result.printer.forEach(function (printer) {            
               if (printer.name === '24a070200057') {                 
                    barcodePrinter = printer;            
               } else if (printer.name === '46j094300866') {                 
                    stockReceiptPrinter = printer;                 
                    stockReceiptPrinter.send(zpl);             
               }        
          });   
     }, function () {});
}); 

I am using BrowserPrint v1.0.4.min.js and zebra-browser-print-setup-1.2.0.3.exe

0-02-04-073a9ba70234aad1f5e0e19d903f18972d8f974de2da21394418da025a1adb8b_full.jpg

Yanko Belov
could you please take a look?

could you please take a look?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Yanko, Unfortunately I

Hi Yanko, Unfortunately I believe this is part of a known issue with certain multi-byte characters that is being worked on now.  We will let you know when there is a patch.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Yanko Belov
Hi Robin, thanks... I am not

Hi Robin, thanks... I am not very happy with this because I based my solution on "Browser print" but I look forward to the patch.

By the way congrats for the "Browser print" feature/plugin it is totally awesome, keep working in this direction.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Diky Lee
Hi, Robin. I hope this issue

Hi, Robin.

I hope this issue will be patched soon.

Could you let me know expected date?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Kent Kim
Hi, Robin.Same problem here.I

Hi, Robin.

Same problem here.

I wonder if we have to choose other solution for this issue.

ZPL command through zebra setup utilities works fine but the same command via browser print doesn't work.

I checked BrowserPrint.js sends request to the local server(port 9100/9101) with request header sets charset utf-8 on firefox and edge.

So the problem might be the local server's encoding or some processes of the requested string on the server side.

Please let us know the expected date when possible.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Yanko Belov
  are there any news about

  are there any news about this issue?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Maksim Cherniaev
Some guy wrote a solution on

Some guy wrote a solution on StackOverflow - you can send escaped characters with UTF-8 encoding like this. It works fine.

^XA

^LH40,20

^F30,10^BY2

^BCN,64,Y,N,N,A

^FD000100003456789^FS

^CWT,E:TT0003M_.FNT

^CFT,25,25

^CI28

^FT0,110^FH^FD_D0_94_D0_BE_D1_81_D0_B2_D0_B8_D0_B4_D0_B0_D0_BD_D0_B8_D1_8F_D0_BD_D0_B8_D1_8F_D0_BD_D0_B8_D1_8F_D0_BD_D0_B8_D1_8F_D0_BD_D0_B8_D1_8F^FS

^FT0,135^FH^FD_D0_94_D0_BE_D1_81_D0_B2_D0_B8_D0_B4_D0_B0_D0_BD_D0_B8_D1_8F^FS

^FT0,160^FH^FD_D0_94_D0_BE_D1_81_D0_B2_D0_B8_D0_B4_D0_B0_D0_BD_D0_B8_D1_8F^FS

^XZ

Hope this helps.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Yanko Belov
​ could you please post a

​ could you please post a link to StackOverflow?

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Maksim Cherniaev
Hello, Yanko!You have to user

Hello, Yanko!

You have to user EncodeURI on your product_name var. Here’s my code

“SplitNameInParts” function is just for splitting long text into 20 characters parts to print in two lines on a sticker. The point is to user EncodeURI, here’s piece of my js script:

var parts = splitNameInParts(bc_descr, 20)

//Начальная позиция первой строки наименование типа

var pos = 95

//Начать сеанс работы

var p = '^XA'

//Стартовые координаты печати x,y

p += '^LH30,20'

//Штрих-код (Тут лучше ничего не трогать)

p += 'F30,10BY2'

p += '^BCN,64,Y,N,N,A'

p = '^FD'barcode+'^FS'

//Установка шрифта (Тут тоже лучше ничего не трогать)

p += '^CWT,E:TT0003M_.FNT'

//Размер шрифта

p += '^CFT,25,25'

//Кодировка utf-8

p += '^CI28'

//Построчная печать наименования типа документа

for (var i = 0; (i < 3)&&(!!parts[i]); i++) {

pos += 25

p = ('^FT0,'pos'FHFD'encodeURI(parts[i]).replace (/%/g, '_')+'^FS')

}

//Конец сеанса работы

p = p + '^XZ'

//Отправка команды в принтер

selected_printer.send(p);

Maxim Cherniyaev

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments