[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#522776: debian-policy: mandate existence of a standardised UTF-8 locale



On Tue, Apr 07, 2009 at 10:01:16PM +0000, Thorsten Glaser wrote:
> Roger Leigh dixit:
> 
> >But, does it not reject non 7-bit input in the C
> >locale for completeness?
> 
> No, it doesn't - "we" (before my time though, I think) fought
> hard for eight-bit transparence and eight-bit cleanliness.
> 
> >Should tools doing "raw" I/O not be using lower level interfaces
> >such as fread() and fwrite()
> 
> These too are affected.

Are you sure?  The documentation does not suggest they are affected
by locale.  These functions are operating on binary objects, and
should not be affected by the locale.  From SUSv3:

fwrite - binary output
The fwrite() function shall write, from the array pointed to by ptr, up to
nitems elements whose size is specified by size, to the stream pointed to by
stream. For each object, size calls shall be made to the fputc() function,
taking the values (in order) from an array of unsigned char exactly overlaying
the object.

And for fputc

fputc - put a byte on a stream
The fputc() function shall write the byte specified by c (converted to an
unsigned char) to the output stream pointed to by stream, at the position
indicated by the associated file-position indicator for the stream (if
defined), and shall advance the indicator appropriately. If the file cannot
support positioning requests, or if the stream was opened with append mode, the
byte shall be appended to the output stream.


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.

Attachment: signature.asc
Description: Digital signature


Reply to: