[Top] [Prev] [Next]

utfbytes

utfbytes - compute the Unicode length of a UTF byte sequence

Synopsis

include "sys.m";
sys:= load Sys Sys->PATH;
utfbytes: fn(buf: array of byte, n: int): int;

Description

The utfbytes function examines the n -byte UTF sequence in starting at buf [0] and returns the length of the subsequence as the number of bytes, if any, that represent a single Unicode character. The end of the array may contain an incomplete UTF sequence without affecting the return value.

See Also

Limbo System Modules, byte2char, and utf

Caveat

A call to utfbytes can generate a bounds check error if the length argument is larger than the array itself.



[Top] [Prev] [Next]

infernosupport@lucent.com
Copyright © 1996,Lucent Technologies, Inc. All rights reserved.