RE: Non-ascii string processing?

From: Marco Cimarosti (
Date: Mon Oct 06 2003 - 04:09:34 CST

Doug Ewell wrote:
> Depends on what "processing" you are talking about. Just to cite the
> most obvious case, passing a non-ASCII, UTF-8 string to byte-oriented
> strlen() will fail dramatically.

Why? The purpose of strlen() is counting the number of *bytes* needed to
store a certain string, and this works just as fine for UTF-8 as it does for
SBCS's or DBCS's.

What strlen() cannot do is countîng the number of *characters* in a string.
But who cares? I can imagine very few situations where someone such an
information would be useful.

_ Marco

This archive was generated by hypermail 2.1.5 : Thu Jan 18 2007 - 15:54:24 CST