Haiku API Bindings
String
Not logged in

Documentation | SupportKit | String

DESCRIPTION

There are three basic types of strings involved in the glue code. First, a string of bytes. These can contain any bytes, including embedded null bytes. Second, a string of UTF-8 characters. These cannot contain embedded null bytes, and must contain a final null indicating the end of the string. Third, a BString, which is a string of UTF-8 characters wrapped in an object.

The glue code will automatically convert these to and from native strings as needed.

Perl

Perl makes a distinction between utf8 (its own internal representation) and UTF-8 (the somewhat stricter offical format). Normally you should be okay, but if you run into problems try:

use Encode;

my $strict = encode("UTF-8", $value);

When returning string values, the utf8 flag is turned on if the value is a

valid utf8 string.