[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;

Description

The utfbytes function examines the n -byte UTF sequence starting at buf [0] and returns 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.

Caveat

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

See Also
Limbo System Module

byte2char, char2byte - convert between bytes and characters

UTF, Unicode, ASCII - character set and format in Appendix A



[Top] [Prev] [Next]

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