To: vim-dev@vim.org Subject: Patch 6.1.029 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.029 Problem: When 'encoding' is an 8-bit encoding other than "latin1", editing a utf-8 or other Unicode file uses the wrong conversion. (Jan Fedak) Solution: Don't use Unicode to latin1 conversion for 8-bit encodings other than "latin1". Files: src/fileio.c *** ../vim61.028/src/fileio.c Tue Mar 19 22:34:17 2002 --- src/fileio.c Tue Apr 23 20:49:02 2002 *************** *** 847,853 **** * conversion to UTF-8 except how the resulting character is put in * the buffer. */ ! else if (enc_utf8 || !has_mbyte) fio_flags = get_fio_flags(fenc); # ifdef USE_ICONV --- 847,853 ---- * conversion to UTF-8 except how the resulting character is put in * the buffer. */ ! else if (enc_utf8 || STRCMP(p_enc, "latin1") == 0) fio_flags = get_fio_flags(fenc); # ifdef USE_ICONV *************** *** 3113,3119 **** * Latin1 to Unicode conversion. This is handled in buf_write_bytes(). * Prepare the flags for it and allocate bw_conv_buf when needed. */ ! if (converted && (enc_utf8 || !has_mbyte)) { wb_flags = get_fio_flags(fenc); if (wb_flags & (FIO_UCS2 | FIO_UCS4 | FIO_UTF16 | FIO_UTF8)) --- 3113,3119 ---- * Latin1 to Unicode conversion. This is handled in buf_write_bytes(). * Prepare the flags for it and allocate bw_conv_buf when needed. */ ! if (converted && (enc_utf8 || STRCMP(p_enc, "latin1") == 0)) { wb_flags = get_fio_flags(fenc); if (wb_flags & (FIO_UCS2 | FIO_UCS4 | FIO_UTF16 | FIO_UTF8)) *** ../vim61.028/src/version.c Tue Apr 23 22:08:09 2002 --- src/version.c Tue Apr 23 22:10:05 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 29, /**/ -- FATHER: One day, lad, all this will be yours ... PRINCE: What - the curtains? "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ /// Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim \\\ \\\ Project leader for A-A-P -- http://www.a-a-p.org /// \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///