Quote Originally Posted by YuriyRusinov View Post
Qt Code:
  1. int nlen=fileUrl.toString().size();
  2. OUStringBuffer buf;
  3. for (int i=0; i<nlen; i++)
  4. buf.append( fileUrl.toString().toStdString().at(i) );
To copy to clipboard, switch view to plain text mode 
Do you try to win the 'What's the most inefficient way to convert a string' contest? It does not event work when fileUrl contains non-Latin1 characters.

As d_stranz already mentioned, OString is a char string so I would simply use the ctor which takes a char*: https://www.openoffice.org/api/docs/...l#OString-1240

Qt Code:
  1. const QByteArray ba = fileUrl.toString().toUtf8()
  2. OString ostr = OString(ba.data(), ba.size());
To copy to clipboard, switch view to plain text mode