in reply to UTF8 question

U8 is an unsigned octet, a typedef of unsigned char on most compilers. U8* is like unsigned char * which in C is also the type of an array or string of characters, as well as a pointer to a single character. An offset in the string or index into the array is simply added to the base pointer to get the offset reference.

You'll need XS, Inline::C, or similar to make use of the API functions and macros.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: UTF8 question
by dbp (Pilgrim) on Sep 24, 2002 at 01:06 UTC

    Thanks for the clarification of U8. I realize that I need XS or Inline::C to use API functions but are there perl functions that wrap any of the UTF8 stuff? The utf8 pragma doesn't seem to be what I'm looking for. There are a couple of modules on CPAN but what I'd really like to do is make sure a given string is utf8 inside the perl part of my module and fix it if it isn't (this can be a bit of a pain in c) and then do the lower level manipulation I need to do (using some c-only libraries) using Inline::C.

    This brings me to another question: Say a perl variable holds data encoded in utf8, if I pass that variable to a c function and SvPV the SV* will the c-style string I get back be utf8?