Skip to content

Issues with existing _codepage definition #72

@mafkas

Description

@mafkas

Dear all,

Currently when you initialize the printer the default codepage on the constructor is IBM860.
I don't know if this code page is applied to the printer but certainly if you change this codepage does not applied to the printer.

Is used only to encode the data by this codepage.

private void AppendString(string value, bool useLf)
{
if (!string.IsNullOrEmpty(value))
{
if (useLf)
{
value += "\n";
}

    List<byte> list = new List<byte>();
    if (_buffer != null)
    {
        list.AddRange(_buffer);
    }

    byte[] bytes = Encoding.GetEncoding(_codepage).GetBytes(value);
    list.AddRange(bytes);
    _buffer = list.ToArray();
}

}

Trying to print GREEK using the codepage IBM869 does nothing unless you send the necessary command to the printer
//IBM869
// Alternatively, set code page to CP869 for Greek characters
printer.Append(new byte[] { 0x1B, 0x74, 38 }); // CP869

My suggestion is that the codepage provided to the constructor send the required command to the printer also.

Thanks and hope that will help anyone facing this issue :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions