[Python-checkins] python/dist/src/Modules _iconv_codec.c,1.11,1.12

doerwalter@users.sourceforge.net doerwalter@users.sourceforge.net
Fri, 21 Feb 2003 10:18:52 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv9676/Modules

Modified Files:
	_iconv_codec.c 
Log Message:
Use 'ISO8859-1' instead of 'ASCII' when testing whether byteswapping
is required for the chosen internal encoding in the init function,
as this seems to have a better chance of working under Irix and
Solaris.

Also change the test character from '\x01' to '0'.

This might fix SF bug #690309.


Index: _iconv_codec.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_iconv_codec.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** _iconv_codec.c	18 Feb 2003 16:11:11 -0000	1.11
--- _iconv_codec.c	21 Feb 2003 18:18:49 -0000	1.12
***************
*** 664,668 ****
      PyObject *m;
  
!     char in = 1;
      char *inptr = ∈
      size_t insize = 1;
--- 664,668 ----
      PyObject *m;
  
!     char in = '0';
      char *inptr = ∈
      size_t insize = 1;
***************
*** 672,676 ****
      size_t res;
  
!     iconv_t hdl = iconv_open(UNICODE_ENCODING, "ASCII");
  
      if (hdl == (iconv_t)-1) {
--- 672,676 ----
      size_t res;
  
!     iconv_t hdl = iconv_open(UNICODE_ENCODING, "ISO8859-1");
  
      if (hdl == (iconv_t)-1) {
***************
*** 689,698 ****
      /* Check whether conv() returned native endianess or not for the chosen
         encoding */
!     if (out == 0x1)
         byteswap = 0;
  #if Py_UNICODE_SIZE == 2
!     else if (out == 0x0100)
  #else
!     else if (out == 0x01000000)
  #endif
         byteswap = 1;
--- 689,698 ----
      /* Check whether conv() returned native endianess or not for the chosen
         encoding */
!     if (out == 0x30)
         byteswap = 0;
  #if Py_UNICODE_SIZE == 2
!     else if (out == 0x3000)
  #else
!     else if (out == 0x30000000)
  #endif
         byteswap = 1;