texttops in CUPS 1.3
Opher Shachar
ophers at ladpc.co.il
Tue Jan 29 11:53:19 PST 2008
> Opher Shachar wrote:
> >>>>Opher Shachar wrote:
> >>>>
> >>>>>In CUPS version 1.2.12 I can submit a print job with:
> >>>>>
> >>>>> lp -d MyPrinter -o document-format="text/plain;charset=iso-8859-8" an_iso-8859-8_file.text
> >
> >>Helge Blischke wrote:
> >>
> >>But be aware that this might be changed in future releases.
> >
> > I hope it stayes on for all eternity :)
Look at job.c in the current trunk r7267 here:
http://svn.easysw.com/public/cups/trunk/scheduler/job.c
in the function start_job() you have:
<code>
attr = ippFindAttribute(job->attrs, "document-format",
IPP_TAG_MIMETYPE);
if (attr != NULL &&
(optptr = strstr(attr->values[0].string.text, "charset=")) != NULL)
snprintf(charset, sizeof(charset), "CHARSET=%s", optptr + 8);
else
{
attr = ippFindAttribute(job->attrs, "attributes-charset",
IPP_TAG_CHARSET);
snprintf(charset, sizeof(charset), "CHARSET=%s",
attr->values[0].string.text);
}
</code>
So, this functionality is with us still in 1.4 (and forever?).
I whould suggest reenabling the feature out-of-the-box by re-including the charset files from the 1.2 branch AND documenting this.
>
> Like the author of Perl's Encode modules, I am not sufficiently aquainted to
> the ltor and rtol conversion stuff. There is a Text::Bidi module by Moshe
> Kamensky available on CPAN, but I've no experience with that.
See also this: http://search.cpan.org/~smalyshev/Lingua-IW-Logical-0.5/Logical.pod
I think the function is self-reverible, ie:
log2vis_string( log2vis_string(l_str) ) == l_str
(I'm not sure though.)
>
> By the way, the texttops filter implements some right to left handling
> but AFAIR there is something more than just inverting the sequence
> of characters.
Absolutly! A simple reversal of (suppose lower case latin is hebrew):
my phone number: +972 (3) 7323836
gives:
6383237 )3( 279+ :rebmun enohp ym
>
> Perhaps we could join our knowledge and hack a "well formed" solution?
>
If there is any specific thing I can help with I'll be pleased.
Opher.
More information about the cups
mailing list