From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#12051: 24.1; rcirc-send-message doesn't take multibyte into account. Date: Thu, 16 Aug 2012 18:20:40 +0300 Message-ID: <83a9xuvp6f.fsf@gnu.org> References: <87boj3byqy.fsf@acerpad.localdomain> <83k3x1jx3p.fsf@gnu.org> <874no4apau.fsf@acerpad.localdomain> <83628kkgjw.fsf@gnu.org> <831uj8jdl3.fsf@gnu.org> <83d32rv9bn.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1345130543 25097 80.91.229.3 (16 Aug 2012 15:22:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 16 Aug 2012 15:22:23 +0000 (UTC) Cc: 12051@debbugs.gnu.org To: Leo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 16 17:22:22 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T21tq-0000un-IC for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Aug 2012 17:22:18 +0200 Original-Received: from localhost ([::1]:49961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T21tp-000838-Ba for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Aug 2012 11:22:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T21tm-00082s-9B for bug-gnu-emacs@gnu.org; Thu, 16 Aug 2012 11:22:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T21tk-0001Vr-RR for bug-gnu-emacs@gnu.org; Thu, 16 Aug 2012 11:22:14 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52316) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T21tk-0001Vj-O6 for bug-gnu-emacs@gnu.org; Thu, 16 Aug 2012 11:22:12 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T222I-0000on-4r for bug-gnu-emacs@gnu.org; Thu, 16 Aug 2012 11:31:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Aug 2012 15:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12051 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 12051-submit@debbugs.gnu.org id=B12051.13451310273104 (code B ref 12051); Thu, 16 Aug 2012 15:31:02 +0000 Original-Received: (at 12051) by debbugs.gnu.org; 16 Aug 2012 15:30:27 +0000 Original-Received: from localhost ([127.0.0.1]:33628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T221i-0000o0-EB for submit@debbugs.gnu.org; Thu, 16 Aug 2012 11:30:26 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:64275) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T221f-0000nr-Tn for 12051@debbugs.gnu.org; Thu, 16 Aug 2012 11:30:24 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M8U00E00T6U2T00@a-mtaout22.012.net.il> for 12051@debbugs.gnu.org; Thu, 16 Aug 2012 18:20:31 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M8U00DY1TA7VH50@a-mtaout22.012.net.il>; Thu, 16 Aug 2012 18:20:31 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:63230 > From: Leo > Cc: 12051@debbugs.gnu.org > Date: Thu, 16 Aug 2012 11:16:04 +0800 > > On 2012-08-16 10:50 +0800, Eli Zaretskii wrote: > >> By worst expansion, do you mean assuming each char to be 5 bytes? > > > > Yes. > > The will split English text at the boundary of 84 chars which seems > sub-optimal. Why is it suboptimal? (I don't know anything about rcirc.) If it's important to be better in this case, you could detect it (e.g., by matching the string against [:ascii:]). Another ide is to use string-bytes to find out where to break a string on a character boundary without exceeding the maximum allowed byte count in a message. > In the current implementation of rcirc-split-message, the inner loop > might not be run if the encoding is utf-8, which we can assume to be 90% > of the cases. So my suggestion is to leave it alone until we hit a real > case of inefficiency. What do you think? I'm okay with the current code if you are, but I still think a more elegant solution should be possible.