glibmm 2.4: ustring.h File Reference

Main Page Widgets Namespaces Book

# ustring.h File Reference

## Namespaces
namespace | Glib
## Functions
gunichar | get_unichar_from_std_iterator (std::string::const_iterator pos) G_GNUC_PURE
| Extract a UCS-4 character from UTF-8 data.

## Function Documentation

gunichar get_unichar_from_std_iterator | ( | std::string::const_iterator | pos | ) |

| Extract a UCS-4 character from UTF-8 data. Convert a single UTF-8 (multibyte) character starting at `pos` to a UCS-4 wide character. This may read up to 6 bytes after the start position, depending on the UTF-8 character width. You have to make sure the source contains at least one valid UTF-8 character. This is mainly used by the implementation of Glib::ustring::iterator, but it might be useful as utility function if you prefer using std::string even for UTF-8 encoding.