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

  • Home
  • SEARCH
  • 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 867735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:01:41+00:00 2026-05-15T10:01:41+00:00

I am writing C# application that need to print data to POS STAR printer

  • 0

I am writing C# application that need to print data to POS STAR printer using RawPrinterHelper.

My printing works fine except when I sending characters like ŽĆČĐŠ.
Then I get wrong data printed out.

Until now my research give me following results.

If I in PowerShell open good old edit and in txt file write my characters (ŽĆČĐŠ)
and send that to printer I get print out as I wish

I can’t that repeat using Notepad

How I can in C# encode my sting to looks like that one from command prompt (EIDTor). So
when I send data to printer it print Desire fonts as it looks like in Windows environment.

I did also try to print using Star driver and their C# sample for sending data directly to printer but without success.

EDIT:


I did it, and for others Who in generally have troubles printing directly on Star printers using C#
here is code for sample app from Star IO Programming Tool for using their driver.

using System;
using System.Text;
using StarMicronics.StarIO; // added as a reference from the "Dependencies" directory
                            // requires StarIOPort.dll, which is copied to the output directory by the Post-Build event

namespace TestEnkodera
{
    class Program
    {
        static void Main(string[] args)
        {
            string portName = "LPT1";
            string portSettings = string.Empty;
            string print = string.Empty;

            //Select code page  
            //Decimal  27  29  116  n
            print += string.Format("{0}{1}{2}{3}{4}", (char)27, (char)29, (char)116, (char)5, Environment.NewLine);

            print += "Đ Š Ž Ć Č ž ć č ć \n";            

            IPort port = null;
            port = StarMicronics.StarIO.Factory.I.GetPort(portName, portSettings, 10 * 1000);
            //byte[] command = ASCIIEncoding.ASCII.GetBytes(print); //This was orginal code provided by STAR

            Encoding ec = Encoding.GetEncoding(852); //Here is way to set CODEPAGE to match with printer CODE PAGE
            byte[] command = ec.GetBytes(print);
            uint totalSizeCommunicated = WritePortHelper(port, command);
            StarMicronics.StarIO.Factory.I.ReleasePort(port);
            Console.ReadKey();
        }
        private static uint WritePortHelper(IPort port, byte[] writeBuffer)
        {
            uint zeroProgressOccurances = 0;
            uint totalSizeCommunicated = 0;
            while ((totalSizeCommunicated < writeBuffer.Length) && (zeroProgressOccurances < 2)) // adjust zeroProgressOccurances as needed
            {
                uint sizeCommunicated = port.WritePort(writeBuffer, totalSizeCommunicated, (uint)writeBuffer.Length - totalSizeCommunicated);
                if (sizeCommunicated == 0)
                {
                    zeroProgressOccurances++;
                }
                else
                {
                    totalSizeCommunicated += sizeCommunicated;
                    zeroProgressOccurances = 0;
                }
            }
            return totalSizeCommunicated;
        }
    }
}
  • 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-15T10:01:42+00:00Added an answer on May 15, 2026 at 10:01 am

    If you’re taking of the DOS editor, you’re dealing with a legacy encoding.

    Have a look at this link: http://msdn.microsoft.com/en-us/library/cc488003.aspx

    At some time you’re converting characters to bytes to send them to the printer. You probably do that using an StreamWriter or so. Now you have to supply this “converter” the correct encoding, which in the end does convert the characters to the correct byte representation for the printer, so that the extended characters match.

    A list of encodings (for DOS codepages) can be found here: http://msdn.microsoft.com/en-us/library/system.text.encoding.aspx – a common one is ibm850 (western european).

    Edit: I found the following information online, maybe it helps (I actually think that code page 0 “Normal” is #850 Latin-1):

    Star Micronics Character Code Tables Reference
    
    Code Page | Description 
    0         | Normal
    1         | #437 USA, Std Europe
    2         | Katakana
    3         | #437 USA, Std Europe
    4         | #858 Multilingual
    5         | #852 Latin-2
    6         | #860 Portuguese
    7         | #861 Icelandic
    8         | #863 Canadian French
    9         | #865 Nordic
    10        | #866 Cyrillic Russian
    11        | #855 Cyrillic Bulgarian
    12        | #857 Turkey
    13        | #852 Israel
    14        | #864 Arabic
    15        | #737 Greek
    16        | #851 Greek
    17        | #869 Greek
    18        | #929 Greek
    19        | #772 Lithuanian
    20        | #774 Lithuanian
    21        | #874 Thai
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing an application in C# that will need to find placeholders in
I'm currently writing a application that allows to save drafts (using android version >=
I'm writing an application that creates a Catalog of files, which can be attributed
I have some HIGHLY sensitive data that I need to expose to Android and
I'm writing a web application that constantly retrieves XML components from a database and
I really have a strange situation. I'm making a Linux multi-threaded C application using
I am in the process of writing an application in which I use the
The scenario is this: My company has 2000 customers, and we need to send
A couple of weeks ago i have started my research in Iphone app development
I'm currently investigating various logging possibilities for .net projects and I can't decide between

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.