The latter. For Shift-JIS, each character consists of one or two bytes, while if you happened to be running on a (non-existent) device that used UTF-8, a character could be one, two, three, or even (though not with the current Palm OS) four bytes.A couple questions about multibyte strings... Do all the characters in the same encoding use the same number of bytes per character, or is it possible for an encoding to use 3 bytes for one character, 1 for another, etc?
strlen and StrLen both work fine in this case, since they return a byte count, not a character count. Note that all of the Palm OS APIs are in terms of bytes (lengths & offsets), not characters, even though some of the names would lead you to believe otherwise.Is there a string library available anywhere for multibyte strings or does everyone roll their own strlen,
The String Mgr routines are all safe to use with multi-byte character encodings.
StrAToI() only converts single-byte numbers. In general conversion of other numeric forms (e.g. double-byte equivalents and "native" numeric variants) isn't commonly useful.atoi,
strtok, etc?
strtok isn't part of the standard Palm OS API.
Between the String Mgr and the Text Mgr, you should have most of what you need. There are some holes - for example, there's no easy way to do a case-insensitive StrStr/strstr.It'd be nice to see a class for multibyte chars that overload [] and provides string.h functionality.
-- Ken
--
Ken Krugler
<http://www.krugler.org>
+1 530-265-2225
--
For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
