mirror of
https://github.com/SourMesen/Mesen.git
synced 2025-04-02 10:52:48 -04:00
NSF: Fixed bug with empty song/artist/copyright/ripper fields
This commit is contained in:
parent
7cef14a28c
commit
0cf56d093c
1 changed files with 4 additions and 4 deletions
|
@ -705,16 +705,16 @@ namespace Mesen.GUI
|
|||
private string ConvertString(Byte[] input)
|
||||
{
|
||||
string output = Encoding.UTF8.GetString(input, 0, Array.IndexOf(input, (Byte)0));
|
||||
if(output.Length == 0 || output == "<?>") {
|
||||
return ResourceHelper.GetMessage("NsfUnknownField");
|
||||
}
|
||||
|
||||
if(output[0] == 0xFFFD) {
|
||||
//Patch to convert an invalid character at index 0 to a copyright sign
|
||||
//This is usually the case for NSFe files (not sure what the encoding for NSF/NSFe is meant to be. Is it properly defined?)
|
||||
return "©" + output.Substring(1);
|
||||
}
|
||||
|
||||
if(output == "<?>") {
|
||||
return ResourceHelper.GetMessage("NsfUnknownField");
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue