MuseScore/mscore/importmidi_inner.cpp
2013-09-28 01:27:16 +04:00

30 lines
698 B
C++

#include "importmidi_inner.h"
#include "preferences.h"
namespace Ms {
namespace MidiCharset {
QString convertToCharset(const std::string &text)
{
// charset for the current MIDI file
QString charset = preferences.midiImportOperations.charset();
auto *codec = QTextCodec::codecForName(charset.toLatin1());
if (codec)
return codec->toUnicode(text.c_str());
else
return QString::fromStdString(text);
}
QString defaultCharset()
{
return "UTF-8";
}
std::string fromUchar(const uchar *text)
{
return reinterpret_cast<const char*>(text);
}
} // namespace MidiCharset
} // namespace Ms