Logo Search packages:      
Sourcecode: ardour version File versions  Download package

std::string Glib::filename_from_utf8 ( const Glib::ustring utf8_string  ) 

Converts a string from UTF-8 to the encoding used for filenames.

Parameters:
utf8_string A UTF-8 encoded string.
Returns:
The converted string.
Exceptions:
Glib::ConvertError 

Definition at line 215 of file convert.cc.

References Glib::ustring::bytes(), and Glib::ustring::data().

{
  gsize bytes_written = 0;
  GError* error = 0;

  char *const buf = g_filename_from_utf8(
      utf8_string.data(), utf8_string.bytes(), 0, &bytes_written, &error);

  if(error)
    Error::throw_exception(error);

  return std::string(ScopedPtr<char>(buf).get(), bytes_written);
}


Generated by  Doxygen 1.6.0   Back to index