<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On 14 November 2013 19:07, <a href="mailto:janc@janc.es">janc@janc.es</a> <span dir="ltr"><<a href="mailto:janc@janc.es" target="_blank">janc@janc.es</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi! friends.<br>
<br>
I found ehwn selecting chars in a linux UTF-8 text, in status bar it<br>
count double if it is an extended char, I mean out of ASCII table.<br></blockquote><div><br></div><div>Actually its counting octets in the underlying UTF-8 encoding that the buffer uses, so it could count as high as four for a specific code point. Or possibly higher when a glyph is made of two or more combining characters.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I was using that selection to format the output of script.<br>
<br>
I think it should be the number of 'text chars' not bytes.<br></blockquote><div><br></div><div>The difficulty is, as I alluded to above, what is a "text char"?  Depending on the use-case it could be the octets, the Unicode code points or the glyphs shown on the screen.</div>
<div><br></div><div>Octets is the information returned from the GUI editing component, that is why its what is shown.</div><div><br></div><div>It would be technically possible to scan the selection and count the Unicode code points in it, but it would have performance implications if the selection is large, for example if the user selected the whole document.</div>
<div><br></div><div>There is currently no way of knowing how many glyphs the GUI component used to display a sequence of octets, so the counted code points may not match what you see on the screen anyway.</div><div><br></div>
<div>So I don't think its worth changing, the option available, scanning the selection to count code points each time its changed is potentially slow and may not do what you expect in any case.</div><div><br></div><div>
Cheers</div><div>Lex</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
What you think about?<br>
<br>
Cheers.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Jose Angel Navarro Cortes<br>
email: <a href="mailto:janc@janc.es">janc@janc.es</a><br>
web: <a href="http://janc.es/" target="_blank">http://janc.es/</a><br>
Usuario Linux: #49178<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.geany.org">Users@lists.geany.org</a><br>
<a href="https://lists.geany.org/cgi-bin/mailman/listinfo/users" target="_blank">https://lists.geany.org/cgi-bin/mailman/listinfo/users</a><br>
</font></span></blockquote></div><br></div></div>