Availability:C-language interface function
bool PL_atom_mbchars(atom_t 
atom, size_t len, char *s, unsigned int flags)This function generalizes fetching the text associated with an atom. The 
encoding depends on the flags REP_UTF8, REP_MB 
or REP_ISO_LATIN_1. Storage is defined by the BUF_* 
flags as described with PL_get_chars(). 
The flag CVT_EXCEPTION defines whether or not the function 
fails silently or raises a Prolog exception. This function may fail 
because atom is not a text atom but a blob (see section 
12.4.10), conversion to the requested encoding is not possible or a 
resource error occurs.