unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: eliz@is.elta.co.il, bug-gnu-emacs@gnu.org
Subject: Re: UTF-8 related display problem
Date: Tue, 8 Oct 2002 10:09:35 +0900 (JST)	[thread overview]
Message-ID: <200210080109.KAA16152@etlken.m17n.org> (raw)
In-Reply-To: <5.1.0.14.2.20021007210058.031a7818@pop.puretec.de> (message from	Marc Wilhelm Küster on Mon, 07 Oct 2002 21:07:28 +0200)

In article <5.1.0.14.2.20021007210058.031a7818@pop.puretec.de>, Marc Wilhelm Küster <kuester@saphor.net> writes:
> Please find attached a version of the file that has all ASCII letters (a-z, 
> A-Z) transformed into a's. All non-ASCII letters are left intact. The bug 
> still occurs.

> Just open the file as a UTF-8 text file. Note that the display ends right 
> in a Hebrew passage on line 2883 (the line begins with <a><?aaaa ^@-0?>

I found a bug that is revealed typically by decoding large
utf-8-dos file (your case).

I've just installed the attached fix in HEAD and RC.  Could
you please try it?

---
Ken'ichi HANDA
handa@m17n.org

2002-10-08  Kenichi Handa  <handa@m17n.org>

	* coding.c (code_convert_region): When we need more GAP for
	conversion, pay attention to the case that coding->produced is not
	greater than coding->consumed.

Index: coding.c
===================================================================
RCS file: /cvs/emacs/src/coding.c,v
retrieving revision 1.259
retrieving revision 1.260
diff -u -c -r1.259 -r1.260
cvs server: conflicting specifications of output style
*** coding.c	30 Sep 2002 06:28:31 -0000	1.259
--- coding.c	8 Oct 2002 00:57:59 -0000	1.260
***************
*** 5696,5704 ****
  		REQUIRE + LEN_BYTE = LEN_BYTE * (NEW / ORIG)
  		REQUIRE = LEN_BYTE * (NEW - ORIG) / ORIG
  	     Here, we are sure that NEW >= ORIG.  */
! 	  float ratio = coding->produced - coding->consumed;
! 	  ratio /= coding->consumed;
! 	  require = len_byte * ratio;
  	  first = 0;
  	}
        if ((src - dst) < (require + 2000))
--- 5696,5714 ----
  		REQUIRE + LEN_BYTE = LEN_BYTE * (NEW / ORIG)
  		REQUIRE = LEN_BYTE * (NEW - ORIG) / ORIG
  	     Here, we are sure that NEW >= ORIG.  */
! 	  float ratio;
! 
! 	  if (coding->produced <= coding->consumed)
! 	    {
! 	      /* This happens because of CCL-based coding system with
! 		 eol-type CRLF.  */
! 	      require = 0;
! 	    }
! 	  else
! 	    {
! 	      ratio = (coding->produced - coding->consumed) / coding->consumed;
! 	      require = len_byte * ratio;
! 	    }
  	  first = 0;
  	}
        if ((src - dst) < (require + 2000))

  parent reply	other threads:[~2002-10-08  1:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-05 20:36 UTF-8 related display problem Marc Wilhelm Küster
2002-10-06 18:26 ` Eli Zaretskii
2002-10-07  7:28   ` Marc Wilhelm Küster
2002-10-07 14:32     ` Eli Zaretskii
     [not found]     ` <5.1.0.14.2.20021007210058.031a7818@pop.puretec.de>
2002-10-08  1:09       ` Kenichi Handa [this message]
2002-10-10  9:12         ` Marc Wilhelm Küster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200210080109.KAA16152@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=eliz@is.elta.co.il \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).