[m-users.] Confused by action of string.prefix_length

Sean Charles (emacstheviking) objitsu at gmail.com
Fri Jun 10 16:49:54 AEST 2022


Yes, having now re-read the string module comments a few times over, my head is much clearer…it was just that initial difference between expectation and reality that caught me out.

As Volker says, sorry for the list noise!

Sean


> On 9 Jun 2022, at 02:03, Julien Fischer <jfischer at opturion.com> wrote:
> 
> 
> On Wed, 8 Jun 2022, Sean Charles (emacstheviking) wrote:
> 
>> OK, well the explanation makes sense, I guess in my head I had not
>> fully comprehended what a code point truly is, not being that
>> accustomed to that terminology myself.  At first (naive) reading I
>> ASSUMED it would just return the -visible character count- i.e. the,
>> dare I say it, intuitive value of 3, rather than the surgically
>> precise value of 6!
> 
> In general, counts of visible "characters", code points and code units
> may all differ (e.g. things like combining characters may mean that one
> visible character can be represented by multiple code points, each of
> which may be encoded by several code units.)
> 
> Julien.



More information about the users mailing list