[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Phpprintipp] character s Transliteration [Re: PHP printipp, problèm
From: |
Thomas Harding |
Subject: |
Re: [Phpprintipp] character s Transliteration [Re: PHP printipp, problèm e d'encodage avec CUPS] |
Date: |
Fri, 8 Aug 2008 22:46:03 +0200 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
On Tue, Aug 05, 2008 at 06:33:50PM +0200, Thomas Harding wrote:
> > >$ipp->setMimeMediaType('text/plain');
> > >$ipp->setCharset('utf-8');
> > >$ipp->printJob();
> > >#####################################
>
> > OK, thank you for answering quickly.
> >
> > I I didn't succeed in making it work with CUPS. I was indeed using the
> > last version, but since anyway I want to use it with other printer
> > servers than CUPS afterwards, I decided to convert unicode characters
> > to their ASCII equivalents as much as I could.
Verified again. Works for sure. Setting charset to us-ascii cause
non-ascii characters to not be printed. Did you set up mime type to
'text/plain'?
However, for the usage you plan,
Here are tips for transliteration of characters:
<?php
$fp = fopen('test','r');
$str = fread($fp,1024);
echo iconv('utf-8','us-ascii//TRANSLIT//IGNORE',$str);
?>
########
# file "test"
essai
portez ce vieux whisky au juge blond qui fume
méthanol
œuf
########
# output
essai
portez ce vieux whisky au juge blond qui fume
methanol
oeuf
#########
Note I doubt on reliability for Chinese, Japanese, Thai... for which
printing through CUPS is the only solution.
Maybe a configurable switch in your module setup allowing the two
solutions would do the job?
I'm also interested in reading your code. Could you give me a pointer?
--
=== The BOFH Excuse Server ===
Your excuse is: The MGs ran out of gas.