MDN wants to learn about developers like you:

« Gecko Plugin API Reference « Scripting plugins


NPString is a struct that holds a pointer to a sequence of 8-bit units (NPUTF8) making up a UTF-8 string, and the number of 8-bit units in the UTF-8 string.

Note: Whenever an NPString owns its string data and the data may be released through a call to NPN_ReleaseVariantValue(), the string data must be allocated using NPN_MemAlloc().


typedef struct _NPString {
    const NPUTF8 *UTF8Characters;
    uint32_t UTF8Length;
} NPString;


The data structure has the following fields:

An array of the UTF-8 characters comprising the string.
The number of bytes in the UTF-8 string (not the number of characters).

Document Tags and Contributors

 Contributors to this page: teoli, Eric johansson, Sheppy
 Last updated by: teoli,