js_get_encode(3)

NAME
js_get_encode - determine the encoding that a given js_string object uses

SYNOPSIS
#include JsStr.h

int js_get_encode(js_string *js);

DESCRIPTION
js_get_encode determines the encoding that a given js_string object uses. You can use this function to see if the encoding of a js_string object is ASCII or BINARY. Eventually, this function will allow you to see encodings such as UNICODE-3, ISO 8859-1, etc.

ARGUMENTS
js is a pointer to the js_string object that you wish to view the encoding of.

EXAMPLE
The following example code creates a js_string object, sets the encoding to ASCII, then gets the value of the encoding.

	js_string *foo;
	int encode;
	foo = js_create(256,1);
	js_set_encode(foo,JS_US_ASCII);
	encode = js_get_encode(foo);

RETURN VALUE
js_get_encode returns JS_BINARY for binary data, JS_US_ASCII for data encoded in US ASCII format, and JS_ERROR if it is not able to get the encoding for the js_string object.

AUTHOR
Sam Trenholme <kiwi-zttfryb@koala.samiam.org>