On Wed, Jun 20, 2012 at 02:16:19PM +0400, Александр Орефков wrote:
> 2012/6/20 Lluís Batlle i Rossell <vi...@viric.name>:
> >
> > yes, that has been reported before. It's quite easy to count utf-8... but 
> > maybe
> > not everyone uses utf-8.
> >
> > Should we add a 'setting' for 8-bit or utf-8 characters?
> 
> In Fossil in web pages header set utf-8 code page, so not utf-8 file
> text with non ascii characters anyway will be broken.
> And you need set code page for page in browser for correct view.
> 
> Then it is better to have the ability to specify the encoding for the
> entire site

Ok, fine for me.

Here is a quick code to count utf8 chars:
int my_strlen_utf8_c(char *s) {
    int i = 0, j = 0;
    while (s[i]) {
        if ((s[i] & 0xc0) != 0x80) j++;
        i++;
    }
    return j;
}

From this place: http://www.canonical.org/~kragen/strlen-utf8.html

Regards,
Lluís.
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to