From 0980891b5a38fc1937c8716475f36a567d4d80fe Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 9 Jan 2003 09:00:40 +0000 Subject: [PATCH] Try not to write UTF-8 to DWIs. --- stepmania/src/NotesWriterDWI.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/stepmania/src/NotesWriterDWI.cpp b/stepmania/src/NotesWriterDWI.cpp index 495108bc9d..5fcb73bd3d 100644 --- a/stepmania/src/NotesWriterDWI.cpp +++ b/stepmania/src/NotesWriterDWI.cpp @@ -224,9 +224,13 @@ bool NotesWriterDWI::Write( CString sPath, const Song &out ) if( fp == NULL ) RageException::Throw( "Error opening song file '%s' for writing.", sPath.GetString() ); - if(out.GetFullTitle().GetLength() != 0) - fprintf( fp, "#TITLE:%s;\n", out.GetFullTitle().GetString() ); - if(out.m_sArtist.GetLength() != 0) + /* If we have transliterations, write them instead of the real title, since + * DWI doesn't support UTF-8. */ + if(!out.GetSortTitle().empty()) + fprintf( fp, "#TITLE:%s;\n", out.GetSortTitle().GetString() ); + if(!out.m_sArtistTranslit.empty()) + fprintf( fp, "#ARTIST:%s;\n", out.m_sArtistTranslit.GetString() ); + else if(!out.m_sArtist.empty()) fprintf( fp, "#ARTIST:%s;\n", out.m_sArtist.GetString() ); ASSERT( out.m_BPMSegments[0].m_fStartBeat == 0 ); fprintf( fp, "#BPM:%.3f;\n", out.m_BPMSegments[0].m_fBPM );