Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7671461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:03:47+00:00 2026-05-31T16:03:47+00:00

I use Zebra QL320 plus printer. Fonts was loaded from Win7(sys. encoding CP1251). When

  • 0

I use Zebra QL320 plus printer. Fonts was loaded from Win7(sys. encoding CP1251).
When I send text from Android via bluetooth to printer in russian lng:

! 0 200 200 200 1
ENCODING UTF-8
TEXT 14 0 20 80 Привет мир
PRINT

I have in result something like this:

Привет мир

How I can fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T16:03:48+00:00Added an answer on May 31, 2026 at 4:03 pm

    Here is working example:

    public void bluetoothSendData(String text){
        bluetooth_adapter.cancelDiscovery();
        if (socket_connected) {
            try {
                OutputStream o_stream = socket.getOutputStream();               
                o_stream.write(decodeText(text, "CP1251"));
                Log.i("emi", "Data was sended.");
            } catch (IOException e) {
                bluetoothCloseConnection();
                Log.i("emi", "Send data error: " + e);
            }
        } else {
            Log.i("emi", "Bluetooth device not connected.");
        }
    }
    
    private byte[] decodeText(String text, String encoding) throws CharacterCodingException, UnsupportedEncodingException{
        Charset charset = Charset.forName(encoding);
        CharsetDecoder decoder = charset.newDecoder();
        CharsetEncoder encoder = charset.newEncoder();
        ByteBuffer bbuf = encoder.encode(CharBuffer.wrap(text));
        CharBuffer cbuf = decoder.decode(bbuf);
        String s = cbuf.toString();
        return s.getBytes(encoding);
    }
    

    How I understend, this examle will be work in Fonts what was loaded from OS with encoding CP1251.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have script code for zebra TLP2844 printer in a text file. I need
Use case: I've just entered insert mode, and typed some text. Now I want
use Tk; my $mw=new MainWindow; $mw->geometry(1024x768); $mw->Scrolled(Text, -scrollbars => s, -width => 30,-height=>10)->pack( );
I'm using the RawPrinterHelper class from Microsoft, http://support.microsoft.com/kb/322091 , to print to a Zebra
I'm trying to use addClass to give me zebra-striped tables on my Joomla template.
I'm experimenting with a Zebra TTP8200 thermal printer. For my application I need to
Use case: 3rd party application wants to programatically monitor a text file being generated
I'm looking for Delphi headers to use with the zebra lib I was lucky
I am trying to use quickSearch from http://lomalogue.com/jquery/quicksearch/ website. I don't know how to
I am working with a zebra printer that is defined as default printer on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.