help-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to Generate a Long String of the Same Character


From: Wolfgang Laun
Subject: Re: How to Generate a Long String of the Same Character
Date: Tue, 20 Jul 2021 20:23:14 +0200

On Tue, 20 Jul 2021 at 15:42, Andrew J. Schorr <
aschorr@telemetry-investments.com> wrote:

> On Tue, Jul 20, 2021 at 11:49:05AM +0200, Wolfgang Laun wrote:
> > Some instructions are remarkably "heavy", length() for a string is one.
>
> Are you in a multi-byte locale? Because if not, I'd expect length()
> to be very quick.
>
> Thanks for the hint! I need to handle names like Niʿmatallāh Ibn-Maḥmūd
an-Naẖǧuwānī or الهادوي الوزيري، صارمدن ابراهيم ابن محمد ابن عبد الله or
余子積 in my emacs. I'm not claiming that I can read them :-) The necessity to
parse a long byte string for obtaining the number of characters (length
function) may very well explain why my recursive solution beats the
repeated string duplication.

The future is Unicode with utf-8 encoding, so we might better be prepared
for it.

-W








> Regards,
> Andy
>


-- 
Wolfgang Laun


reply via email to

[Prev in Thread] Current Thread [Next in Thread]