php-i18n Digest 8 Apr 2005 07:52:14 -0000 Issue 281
Topics (messages 853 through 854):
Re: Printing Chinese on Printer
853 by: Tex Texin
Multilingual Web application - how to?
854 by: Denis Gerasimov
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Notepad prints by using the windows driver to format the printed image using
the font specified and send that to the printer rather than text. (The
driver will send text if the
printer has a similar font, for speed).
php draw_text is sending the text bytes to the printer I presume. You need
to send the text in the encoding of the character set of the printer.
First make sure you have a printer with a chinese font.
Then you need to find out the encoding it expects.
The printer manual will tell you this and also tell you the commands to
change the encodings, if it supports more than one.
Not likely to be unicode, more likely to be big-5, etc.
The commands are usually escape sequences, things like: escape, left-paren,
"A".
If you don't have a printer with the chinese character set then you should
instead write to the windows driver and let it configure itself for the
printer.
Tex Texin
Internationalization Architect, Yahoo! Inc.
> -----Original Message-----
> From: Nick Lee [mailto:[EMAIL PROTECTED]
> Sent: Sunday, April 03, 2005 10:00 PM
> To: [email protected]
> Subject: [PHP-I18N] Printing Chinese on Printer
>
>
> Hi,
>
> I'm trying to print Chinese to a printer using PHP's
> printer module (php_printer.dll). My platform is W2K,
> English. I've printed Chinese successfully from
> Notepad, so I know the printer can print Chinese.
>
> I send the bytes to the printer using
> printer_draw_text(). The printer just intreprets the
> bytes as ascii characters, and prints out a string of
> those weird characters. I've used
> mb_convert_encoding() to convert the string to UTF-8
> format before sending it to printer, but the result is
> just another string of weird ascii characters.
>
> So, where is the problem? How do I force the printer
> to interpret the bytes in another encoding? Or ...
> should I convert the bytes into another encoding, such
> as UTF-7, UTF-16, etc???????
>
> Thanks in advance for any help,
> Nick
>
>
> ______________________________________________________________
> ________
> Post your free ad now! http://personals.yahoo.ca
>
> --
> PHP Internationalization Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--- End Message ---
--- Begin Message ---
Hello list,
I need to develop a multilingual web site and I am looking for the best way
of handling this task. There are three main issues I know:
1. Storing multilingual data in a database. Possible solutions I know:
a. many tables, one per each supported language, e.g. news_en, news_de.
b. one table having many columns with translations, e.g. (id, date, text_en,
text_de)
We use MySQL 4.1 as a back-end.
2. Multilingual HTML templates, possible solutions:
a. one generic template for everything, one per each language, like
contents_en.tpl.html, contents_de.tpl.html
b. many localized templates for each page, e.g news_en.tpl.html,
news_de.tpl.html
Template engine is Smarty.
3. Storing current language variable, possible solutions:
a. inside the URL like /en/news/
b. using cookies
c. using sessions
Web server is Apache2+mod_rewrite with PHP5
What are pros and cons for each solution? What are other possible solutions
for the above issues?
Best regards, Denis Gerasimov
Outsourcing Services Manager,
VEKOS, Ltd.
www.vekos.ru
--- End Message ---