[Top] [Prev] [Next]


utfbytes - compute the Unicode length of a UTF byte sequence


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


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


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

[Top] [Prev] [Next]

Copyright © 1996,Lucent Technologies, Inc. All rights reserved.