AudioFileWave: do not use UTF-8 filenames on Windows

As libsndfile does not seem to have an UTF8-compatible implementation
on Windows we have to pass the filename as local 8 bit encoding in order
to make the file written properly.

Closes #530.
This commit is contained in:
Tobias Doerffel
2013-06-11 16:29:58 +02:00
parent 0aaed00cc1
commit 7eafca807b

View File

@@ -69,7 +69,13 @@ bool AudioFileWave::startEncoding()
case 16:
default: m_si.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16; break;
}
m_sf = sf_open( outputFile().toUtf8().constData(), SFM_WRITE, &m_si );
m_sf = sf_open(
#ifdef LMMS_BUILD_WIN32
outputFile().toLocal8Bit().constData(),
#else
outputFile().toUtf8().constData(),
#endif
SFM_WRITE, &m_si );
sf_set_string ( m_sf, SF_STR_SOFTWARE, "LMMS" );
return true;
}