From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29450 invoked by alias); 27 Oct 2015 10:34:57 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36976 Received: (qmail 14789 invoked from network); 27 Oct 2015 10:34:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=iHpDoMPCcruxfDUbwcM4moY7elY6u3ewCrVGDLVL540=; b=wMuyRgBXFrJYFZqHudNP4ij1VS5/ovHJaOIff3gitdKaloBm9r0wwvVCDgHAMXc/+Q SR5/B00sw6FCiaZ5MVodgGCJcvuGu95APkGMooD8AdqMsWKSqcBLWPRKB0f80xmfqUqd HKY2U3dKuQ9IH4ikow5CAfblH+sgSIIzb9aueCXZvsCAubWmelKRg7HJfdEzD7vXbRg2 AnK9lKKEAcPX99yOlfElq5C//ApszUUptn4E2l1COScZ5BBnJbY42OHD5uXX7yUdWB0L zlJQIZ4UeTT6hxH+D8IEzWjHAfPqpvcmj0KUn/aQLyJ81nlVeT8UGzvaMSLG37UWYzFz SR+g== X-Received: by 10.112.168.138 with SMTP id zw10mr20049900lbb.12.1445942094395; Tue, 27 Oct 2015 03:34:54 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20151027091026.5197b79f@pwslap01u.europe.root.pri> References: <20151027091026.5197b79f@pwslap01u.europe.root.pri> From: Sebastian Gniazdowski Date: Tue, 27 Oct 2015 11:34:35 +0100 Message-ID: Subject: Re: Question about mb_metastrlen To: zsh-workers@zsh.org Content-Type: text/plain; charset=UTF-8 On 27 October 2015 at 10:10, Peter Stephenson wrote: > On Tue, 27 Oct 2015 09:31:02 +0100 > The function you're talking about is for a string length, not a > character length. num_in_char counts the number of trailing bytes that > didn't form a wide character. Each will be treated as a single byte. > So each counts 1 for the length of the string. There is the condition: if (ret == MB_INVALID) { Isn't it that if there are many trailing bytes that do not form a character, they will be catched into MB_INVALID, and only last "character" can stay as not yet complete? Best regards, Sebastian Gniazdowski