[cups.bugs] [MOD] STR #2812: transcodes file names in argv

Michael R Sweet msweet at apple.com
Wed Apr 30 17:19:11 PDT 2008


Till Kamppeter wrote:
> Michael Sweet wrote:
>> Martin Pitt wrote:
>>> Hi Michael,
>>>
>>> Michael Sweet [2008-04-29 19:56 -0700]:
>>>> This is working exactly as designed/required.  If you use filenames that
>>>> have a different encoding than the locale, you need to redirect from
>>>> stdin, e.g.:
>>> Sure, that's a workaround, but why deliberately break it in the first
>>> place?  I don't think it is *ever* right to transcode a file name in
>>> argv; unlike I alluded in my initial post, the currently set locale
>>> doesn't influence open(), it just takes the bits as they are.
>> Except that the command-line contains a lot of options which use
>> the locale encoding.  If we don't transcode the command-line, we
>> can't depend on having UTF-8 going to the scheduler, and that
>> includes filenames.
>>
> 
> Is it not the case that the file access is done by the CLI frontend 
> itself and not the scheduler?

Yes, however it is the CUPS API that gets the filename, and at that
point we need UTF-8 because otherwise the CUPS API would have to
deal with wide characters and different character sets.  We want to
work with nul-terminated C strings, as that is what the OS needs, and
we want UTF-8 because that is what the scheduler uses.

-- 
______________________________________________________________________
Michael R Sweet                        Senior Printing System Engineer





More information about the cups-devel mailing list