Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Turkish character output on GP-F80300II #319

Closed
shenol opened this issue Mar 15, 2017 · 6 comments
Closed

Turkish character output on GP-F80300II #319

shenol opened this issue Mar 15, 2017 · 6 comments

Comments

@shenol
Copy link

shenol commented Mar 15, 2017

What should I do to print Turkish characters?

ş ü ö İ ğ ı ç

<?php
header('Content-Type: text/html; charset=utf-8');
require __DIR__ . '\vendor\autoload.php';
use Mike42\Escpos\Printer;
use Mike42\Escpos\PrintConnectors\WindowsPrintConnector;

try {
    
    $connector = new WindowsPrintConnector("ADS");
    $printer = new Printer($connector);
    $printer -> text("Pijamalı hasta, yağız şoföre çabucak güvendi.\n");
    $printer -> cut();
    $printer -> close();
} catch (Exception $e) {
    echo "Couldn't print to this printer: " . $e -> getMessage() . "\n";
}
@shenol shenol changed the title hello, how to support turkish charset! how to support turkish charset! Mar 16, 2017
@mike42
Copy link
Owner

mike42 commented Mar 17, 2017

Could you let me know what type of printer do you have, whether it supports a code page which can encode Turkish characters, and what output you got when you ran this snippet?

The list of code pages can usually be found in the vendor documentation by printing a self-test page.

@shenol
Copy link
Author

shenol commented Mar 17, 2017

whatsapp image 2017-03-17 at 16 42 15

printer: grpinter f80300ii

@mike42
Copy link
Owner

mike42 commented Mar 18, 2017

Ok. As a quick check, I don't think printer can print Turkish characters. Your best bet would be one of these these legacy code pages-

But the vendor documentation I found lists these pages:

# Page
0 PC437 [U.S.A.Standard Europe]
1 Katakana
2 PC850:Multilingual
3 PC860:Portuguese
4 PC863 [Canadian French]
6 PC865:Nordic
7 Greek
8 Hebrew
9 PC755:East Europe
10 Iran
16 WPC1252
17 PC866:Cyrillic 2
18 PC852:Latin2
19 PC858
20 IranII
21 Latvian

(Source: GP-80XXX Programmer Manual v6)

So to print these characters, you would need to use a work-around that involves generating images with a Unicode font. A user recently had the same problem printing Vietnamese, so you will find some great information on the issue tracker already.

I'll add a link here once that work-around is in the FAQ.

Also, if I post the script to do it, would you be willing to post back the contents of a few of these code pages to help me identify them?

@mike42 mike42 removed the needs info label Mar 19, 2017
@shenol
Copy link
Author

shenol commented Mar 20, 2017

We do not have a chance to print directly. It works with other language plugin support. It would be a great printing solution for my cloud based application. @mike42 Can you write a sample ? It did not work out.

@mike42 mike42 changed the title how to support turkish charset! Turkish output on GP-F80300II Mar 30, 2017
@mike42 mike42 changed the title Turkish output on GP-F80300II Turkish character output on GP-F80300II Mar 30, 2017
@shenol
Copy link
Author

shenol commented Apr 12, 2017

Sound check :)

@mike42
Copy link
Owner

mike42 commented Jun 18, 2018

Going to close this off as there isn't anything much we can do here.

@mike42 mike42 closed this as completed Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants