Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]strlen() for UTF-8 . . . . . . . . (was Re: Learn a Variety of Languages) [tlug]
- Date: Tue, 16 Jan 2007 22:24:12 -0500
- From: Jim <jep200404@example.com>
- Subject: strlen() for UTF-8 . . . . . . . . (was Re: Learn a Variety of Languages) [tlug]
- References: <45AAFDA9.90504@example.com> <78d7dd350701151659n104a93e3v6cd6cb936f4459ed@example.com> <20070115212859.0251adf4.jep200404@example.com> <157AA731-9AC1-4FEF-ABAD-23A5BE8F0C05@example.com> <Pine.NEB.4.64.0701161628390.12325@example.com> <78d7dd350701160014h40155a75n345183640cbccfc5@example.com> <19dd68ba0701160122i1b813c10jf34c0210d53fbbdd@example.com> <op.tl8roo02rtshzt@example.com> <19dd68ba0701160412y2eb95062r6235fed92b752784@example.com> <Pine.NEB.4.64.0701162139360.10912@example.com> <3156339d0701161820lb684aeubcd51914b19a87bf@example.com>
Ian MacLean asked: > ... so how do you *easily* get a character count for a string of > utf-8 bytes ? Call a library function is the proper answer. NIH types can roll their own. >From the description on the Wikipedia page, I figured the following NIH code just for giggles: int utf8strlen(unsigned char *s) { int n=0; for ( ;*s!='\0';s++) if ((*s&0xC0)!=0x80) n++; return n; }
- References:
- [tlug] What is the most appropriate scripting language
- From: Dave M G
- Re: [tlug] Re: Bourne Shell is the most appropriate scripting language
- From: Nguyen Vu Hung
- Learn a Variety of Languages . . . . . . . (was: Re: [tlug] Re: Bourne Shell is the most appropriate scripting language)
- From: Jim
- Re: Learn a Variety of Languages . . . . . . . (was: Re: [tlug] Re: Bourne Shell is the most appropriate scripting language)
- From: Jean-Christophe Helary
- Re: Learn a Variety of Languages . . . . . . . (was: Re: [tlug] Re: Bourne Shell is the most appropriate scripting language)
- From: Curt Sampson
- Re: Learn a Variety of Languages . . . . . . . (was: Re: [tlug] Re: Bourne Shell is the most appropriate scripting language)
- From: Nguyen Vu Hung
- Re: Learn a Variety of Languages . . . . . . . (was: Re: [tlug] Re: Bourne Shell is the most appropriate scripting language)
- From: Guillaume Proux
- Re: Learn a Variety of Languages . . . . . . . (was: Re: [tlug] Re: Bourne Shell is the most appropriate scripting language)
- From: Zev Blut
- Re: Learn a Variety of Languages . . . . . . . (was: Re: [tlug] Re: Bourne Shell is the most appropriate scripting language)
- From: Guillaume Proux
- Re: Learn a Variety of Languages . . . . . . . (was: Re: [tlug] Re: Bourne Shell is the most appropriate scripting language)
- From: Curt Sampson
- Re: Learn a Variety of Languages . . . . . . . (was: Re: [tlug] Re: Bourne Shell is the most appropriate scripting language)
- From: Ian MacLean
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] Re: Learn a Variety of Languages . . . . . . .
- Next by Date: [tlug] CJK Unicode problem . . . . . . . . (was: Re: Learn a Variety of Languages)
- Previous by thread: Re: [tlug] Re: Learn a Variety of Languages . . . . . . .
- Next by thread: Re: Learn a Variety of Languages . . . . . . . (was: Re: [tlug] Re: Bourne Shell is the most appropriate scripting language)
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links