diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2013-03-03 16:51:26 -0600 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2013-03-03 17:08:41 -0600 |
| commit | c07b8a6e3754abb4be5d962d84550d4b10827240 (patch) | |
| tree | 64e39c08bb6feae6cb1670aea5a1976a5b0d4319 /Source/Core/DiscIO/Src/VolumeGC.cpp | |
| parent | b1a29153044d7c6b7d81d88cb9d2c6befd043c4e (diff) | |
Fix more of what I broke.
Diffstat (limited to 'Source/Core/DiscIO/Src/VolumeGC.cpp')
| -rw-r--r-- | Source/Core/DiscIO/Src/VolumeGC.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Source/Core/DiscIO/Src/VolumeGC.cpp b/Source/Core/DiscIO/Src/VolumeGC.cpp index 6e9579571a..6210172790 100644 --- a/Source/Core/DiscIO/Src/VolumeGC.cpp +++ b/Source/Core/DiscIO/Src/VolumeGC.cpp @@ -94,10 +94,12 @@ std::string CVolumeGC::GetMakerID() const std::vector<std::string> CVolumeGC::GetNames() const { std::vector<std::string> names; + + auto const string_decoder = GetStringDecoder(GetCountry()); - char name[128] = {}; - if (m_pReader != NULL && Read(0x20, 0x60, (u8*)&name)) - names.push_back(name); + char name[0x60 + 1] = {}; + if (m_pReader != NULL && Read(0x20, 0x60, (u8*)name)) + names.push_back(string_decoder(name)); return names; } @@ -143,4 +145,10 @@ bool CVolumeGC::IsDiscTwo() const return discTwo; } +auto CVolumeGC::GetStringDecoder(ECountry country) -> StringDecoder +{ + return (COUNTRY_JAPAN == country || COUNTRY_TAIWAN == country) ? + SHIFTJISToUTF8 : CP1252ToUTF8; +} + } // namespace |
