From: <man...@us...> - 2013-12-05 16:43:10
|
Revision: 3379 http://sourceforge.net/p/modplug/code/3379 Author: manxorist Date: 2013-12-05 16:43:01 +0000 (Thu, 05 Dec 2013) Log Message: ----------- [Ref] AMS Loader: Move character set conversion to global charset conversion functions and add tables for AMS1 and AMS2 character sets based on CP437. [Ref] AMS Loader: Set character set back to CP437 instead of Windows-1252 and convert song message using the mpt::CharsetCP437AMS[2] into CP437. [Ref] Remove now unused SongMessage::ConverterFunc . Modified Paths: -------------- trunk/OpenMPT/common/mptString.cpp trunk/OpenMPT/common/mptString.h trunk/OpenMPT/soundlib/Load_ams.cpp trunk/OpenMPT/soundlib/Message.cpp trunk/OpenMPT/soundlib/Message.h trunk/OpenMPT/soundlib/Tables.cpp Modified: trunk/OpenMPT/common/mptString.cpp =================================================================== --- trunk/OpenMPT/common/mptString.cpp 2013-12-05 15:47:00 UTC (rev 3378) +++ trunk/OpenMPT/common/mptString.cpp 2013-12-05 16:43:01 UTC (rev 3379) @@ -63,8 +63,6 @@ -#if defined(MPT_CHARSET_CPP) - /* default 1:1 mapping static const uint32 CharsetTableISO8859_1[256] = { @@ -87,6 +85,8 @@ }; */ +#if defined(MPT_CHARSET_CPP) + static const uint32 CharsetTableISO8859_15[256] = { 0x0000,0x0001,0x0002,0x0003,0x0004,0x0005,0x0006,0x0007,0x0008,0x0009,0x000a,0x000b,0x000c,0x000d,0x000e,0x000f, 0x0010,0x0011,0x0012,0x0013,0x0014,0x0015,0x0016,0x0017,0x0018,0x0019,0x001a,0x001b,0x001c,0x001d,0x001e,0x001f, @@ -144,6 +144,57 @@ 0x2261,0x00b1,0x2265,0x2264,0x2320,0x2321,0x00f7,0x2248,0x00b0,0x2219,0x00b7,0x221a,0x207f,0x00b2,0x25a0,0x00a0 }; +#endif + +#define C(x) ((uint8)(x)) + +// AMS1 actually only supports ASCII plus the modified control characters and no high chars at all. +// Just default to CP437 for those to keep things simple. +static const uint32 CharsetTableCP437AMS[256] = { + C(' '),0x0001,0x0002,0x0003,0x00e4,0x0005,0x00e5,0x0007,0x0008,0x0009,0x000a,0x000b,0x000c,0x000d,0x00c4,0x00c5, // differs from CP437 + 0x0010,0x0011,0x0012,0x0013,0x00f6,0x0015,0x0016,0x0017,0x0018,0x00d6,0x001a,0x001b,0x001c,0x001d,0x001e,0x001f, // differs from CP437 + 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,0x0028,0x0029,0x002a,0x002b,0x002c,0x002d,0x002e,0x002f, + 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,0x0038,0x0039,0x003a,0x003b,0x003c,0x003d,0x003e,0x003f, + 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,0x0048,0x0049,0x004a,0x004b,0x004c,0x004d,0x004e,0x004f, + 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,0x0058,0x0059,0x005a,0x005b,0x005c,0x005d,0x005e,0x005f, + 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,0x0068,0x0069,0x006a,0x006b,0x006c,0x006d,0x006e,0x006f, + 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,0x0078,0x0079,0x007a,0x007b,0x007c,0x007d,0x007e,0x2302, + 0x00c7,0x00fc,0x00e9,0x00e2,0x00e4,0x00e0,0x00e5,0x00e7,0x00ea,0x00eb,0x00e8,0x00ef,0x00ee,0x00ec,0x00c4,0x00c5, + 0x00c9,0x00e6,0x00c6,0x00f4,0x00f6,0x00f2,0x00fb,0x00f9,0x00ff,0x00d6,0x00dc,0x00a2,0x00a3,0x00a5,0x20a7,0x0192, + 0x00e1,0x00ed,0x00f3,0x00fa,0x00f1,0x00d1,0x00aa,0x00ba,0x00bf,0x2310,0x00ac,0x00bd,0x00bc,0x00a1,0x00ab,0x00bb, + 0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556,0x2555,0x2563,0x2551,0x2557,0x255d,0x255c,0x255b,0x2510, + 0x2514,0x2534,0x252c,0x251c,0x2500,0x253c,0x255e,0x255f,0x255a,0x2554,0x2569,0x2566,0x2560,0x2550,0x256c,0x2567, + 0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256b,0x256a,0x2518,0x250c,0x2588,0x2584,0x258c,0x2590,0x2580, + 0x03b1,0x00df,0x0393,0x03c0,0x03a3,0x03c3,0x00b5,0x03c4,0x03a6,0x0398,0x03a9,0x03b4,0x221e,0x03c6,0x03b5,0x2229, + 0x2261,0x00b1,0x2265,0x2264,0x2320,0x2321,0x00f7,0x2248,0x00b0,0x2219,0x00b7,0x221a,0x207f,0x00b2,0x25a0,0x00a0 +}; + +// AMS2: Looking at Velvet Studio's bitmap font (TPIC32.PCX), these appear to be the only supported non-ASCII chars. +static const uint32 CharsetTableCP437AMS2[256] = { + C(' '),0x00a9,0x221a,0x00b7,C('0'),C('1'),C('2'),C('3'),C('4'),C('5'),C('6'),C('7'),C('8'),C('9'),C('A'),C('B'), // differs from CP437 + C('C'),C('D'),C('E'),C('F'),C(' '),0x00a7,C(' '),C(' '),C(' '),C(' '),C(' '),C(' '),C(' '),C(' '),C(' '),C(' '), // differs from CP437 + 0x0020,0x0021,0x0022,0x0023,0x0024,0x0025,0x0026,0x0027,0x0028,0x0029,0x002a,0x002b,0x002c,0x002d,0x002e,0x002f, + 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,0x0038,0x0039,0x003a,0x003b,0x003c,0x003d,0x003e,0x003f, + 0x0040,0x0041,0x0042,0x0043,0x0044,0x0045,0x0046,0x0047,0x0048,0x0049,0x004a,0x004b,0x004c,0x004d,0x004e,0x004f, + 0x0050,0x0051,0x0052,0x0053,0x0054,0x0055,0x0056,0x0057,0x0058,0x0059,0x005a,0x005b,0x005c,0x005d,0x005e,0x005f, + 0x0060,0x0061,0x0062,0x0063,0x0064,0x0065,0x0066,0x0067,0x0068,0x0069,0x006a,0x006b,0x006c,0x006d,0x006e,0x006f, + 0x0070,0x0071,0x0072,0x0073,0x0074,0x0075,0x0076,0x0077,0x0078,0x0079,0x007a,0x007b,0x007c,0x007d,0x007e,0x2302, + 0x00c7,0x00fc,0x00e9,0x00e2,0x00e4,0x00e0,0x00e5,0x00e7,0x00ea,0x00eb,0x00e8,0x00ef,0x00ee,0x00ec,0x00c4,0x00c5, + 0x00c9,0x00e6,0x00c6,0x00f4,0x00f6,0x00f2,0x00fb,0x00f9,0x00ff,0x00d6,0x00dc,0x00a2,0x00a3,0x00a5,0x20a7,0x0192, + 0x00e1,0x00ed,0x00f3,0x00fa,0x00f1,0x00d1,0x00aa,0x00ba,0x00bf,0x2310,0x00ac,0x00bd,0x00bc,0x00a1,0x00ab,0x00bb, + 0x2591,0x2592,0x2593,0x2502,0x2524,0x2561,0x2562,0x2556,0x2555,0x2563,0x2551,0x2557,0x255d,0x255c,0x255b,0x2510, + 0x2514,0x2534,0x252c,0x251c,0x2500,0x253c,0x255e,0x255f,0x255a,0x2554,0x2569,0x2566,0x2560,0x2550,0x256c,0x2567, + 0x2568,0x2564,0x2565,0x2559,0x2558,0x2552,0x2553,0x256b,0x256a,0x2518,0x250c,0x2588,0x2584,0x258c,0x2590,0x2580, + 0x03b1,0x00df,0x0393,0x03c0,0x03a3,0x03c3,0x00b5,0x03c4,0x03a6,0x0398,0x03a9,0x03b4,0x221e,0x03c6,0x03b5,0x2229, + 0x2261,0x00b1,0x2265,0x2264,0x2320,0x2321,0x00f7,0x2248,0x00b0,0x2219,0x00b7,0x221a,0x207f,0x00b2,0x25a0,0x00a0 +}; + +#undef C + +#if MPT_COMPILER_MSVC +#pragma warning(disable:4428) // universal-character-name encountered in source +#endif + static std::wstring From8bit(const std::string &str, const uint32 (&table)[256], wchar_t replacement = L'\uFFFD') //--------------------------------------------------------------------------------------------------------------- { @@ -170,7 +221,10 @@ { uint32 c = str[i]; bool found = false; - for(std::size_t x = 0; x < CountOf(table); ++x) + // Try non-control characters first. + // In cases where there are actual characters mirrored in this range (like in AMS/AMS2 character sets), + // characters in the common range are preferred this way. + for(std::size_t x = 0x20; x < CountOf(table); ++x) { if(c == table[x]) { @@ -181,12 +235,27 @@ } if(!found) { + // try control characters + for(std::size_t x = 0x00; x < CountOf(table) && x < 0x20; ++x) + { + if(c == table[x]) + { + res.push_back(static_cast<char>(static_cast<uint8>(x))); + found = true; + break; + } + } + } + if(!found) + { res.push_back(replacement); } } return res; } +#if defined(MPT_CHARSET_CPP) + static std::wstring FromAscii(const std::string &str, wchar_t replacement = L'\uFFFD') //------------------------------------------------------------------------------------ { @@ -503,6 +572,18 @@ Tdststring EncodeImpl(Charset charset, const std::wstring &src) { STATIC_ASSERT(sizeof(typename Tdststring::value_type) == sizeof(char)); + if(charset == CharsetCP437AMS || charset == CharsetCP437AMS2) + { + std::string out; + switch(charset) + { + case CharsetCP437AMS : out = String::To8bit(src, CharsetTableCP437AMS ); break; + case CharsetCP437AMS2: out = String::To8bit(src, CharsetTableCP437AMS2); break; + } + Tdststring result; + std::copy(out.begin(), out.end(), std::back_inserter(result)); + return result; + } #if defined(MPT_CHARSET_CPP) std::string out; switch(charset) @@ -574,6 +655,18 @@ std::wstring DecodeImpl(Charset charset, const Tsrcstring &src) { STATIC_ASSERT(sizeof(typename Tsrcstring::value_type) == sizeof(char)); + if(charset == CharsetCP437AMS || charset == CharsetCP437AMS2) + { + std::string in; + std::copy(src.begin(), src.end(), std::back_inserter(in)); + std::wstring out; + switch(charset) + { + case CharsetCP437AMS : out = String::From8bit(in, CharsetTableCP437AMS ); break; + case CharsetCP437AMS2: out = String::From8bit(in, CharsetTableCP437AMS2); break; + } + return out; + } #if defined(MPT_CHARSET_CPP) std::string in; std::copy(src.begin(), src.end(), std::back_inserter(in)); @@ -657,6 +750,10 @@ #if defined(MPT_CHARSET_CPP) || defined(WIN32) return EncodeImpl<Tdststring>(to, DecodeImpl(from, src)); #else // !WIN32 + if(to == CharsetCP437AMS || to == CharsetCP437AMS2 || from == CharsetCP437AMS || from == CharsetCP437AMS2) + { + return EncodeImpl<Tdststring>(to, DecodeImpl(from, src)); + } iconv_t conv = iconv_t(); conv = iconv_open(CharsetToStringTranslit(to), CharsetToString(from)); if(!conv) Modified: trunk/OpenMPT/common/mptString.h =================================================================== --- trunk/OpenMPT/common/mptString.h 2013-12-05 15:47:00 UTC (rev 3378) +++ trunk/OpenMPT/common/mptString.h 2013-12-05 16:43:01 UTC (rev 3379) @@ -174,6 +174,8 @@ CharsetISO8859_15, CharsetCP437, + CharsetCP437AMS, + CharsetCP437AMS2, CharsetWindows1252, }; Modified: trunk/OpenMPT/soundlib/Load_ams.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ams.cpp 2013-12-05 15:47:00 UTC (rev 3378) +++ trunk/OpenMPT/soundlib/Load_ams.cpp 2013-12-05 16:43:01 UTC (rev 3379) @@ -18,29 +18,11 @@ #include "stdafx.h" #include "Loaders.h" +#include <iterator> ///////////////////////////////////////////////////////////////////// // Common code for both AMS formats -// Callback function for reading text -static char ConvertAMSTextChars(char c) -//------------------------------------- -{ - // Convert to Windows-1252 for now. - switch((unsigned char)c) - { - case 0x00: return ' '; - case 0x04: return '\xE4'; // Lower-case ae - case 0x06: return '\xE5'; // Lower-case a-ring - case 0x0E: return '\xC4'; // Upper-case AE - case 0x0F: return '\xC5'; // Upper-case A-ring - case 0x14: return '\xF6'; // Lower-case oe - case 0x19: return '\xD6'; // Upper-case OE - } - return c; -} - - // Read variable-length AMS string (we ignore the maximum text length specified by the AMS specs and accept any length). template<size_t destSize> static bool ReadAMSString(char (&destBuffer)[destSize], FileReader &file) @@ -481,8 +463,12 @@ } } + std::string str; + std::copy(textOut.begin(), textOut.end(), std::back_inserter(str)); + str = mpt::To(mpt::CharsetCP437, mpt::CharsetCP437AMS, str); + // Packed text doesn't include any line breaks! - songMessage.ReadFixedLineLength(&textOut[0], textOut.size(), 76, 0, ConvertAMSTextChars); + songMessage.ReadFixedLineLength(str.c_str(), str.length(), 76, 0); } // Read Order List @@ -530,30 +516,6 @@ // AMS (Velvet Studio) 2.0 - 2.02 loader -// Callback function for reading text - looking at Velvet Studio's bitmap font (TPIC32.PCX), these appear to be the only supported non-ASCII chars. -static char ConvertAMS2TextChars(char c) -//-------------------------------------- -{ - // Convert to Windows-1252 for now. - const char controlChars[] = - { - ' ', '\xA9', 'v' /* actually supposed to be a root/check sign */, '\xB7', - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', // Small GUI letters - ' ', '\xA7' - }; - const char highChars[] = { '\xE4', ' ', '\xE5', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '\xC4', '\xC5', ' ', ' ', ' ', ' ', '\xF6', ' ', ' ', ' ', ' ', '\xD6' }; - - if((unsigned char)c < CountOf(controlChars)) - { - return controlChars[(unsigned char)c]; - } else if((unsigned char)c >= 0x84 && (unsigned char)c < 0x84 + CountOf(highChars)) - { - return highChars[(unsigned char)c - 0x84]; - } - return c; -} - - #ifdef NEEDS_PRAGMA_PACK #pragma pack(push, 1) #endif @@ -923,7 +885,10 @@ uint8 composerLength = file.ReadUint8(); if(composerLength) { - songMessage.Read(file, composerLength, SongMessage::leAutodetect, ConvertAMS2TextChars); + std::string str; + file.ReadString<mpt::String::spacePadded>(str, composerLength); + str = mpt::To(mpt::CharsetCP437, mpt::CharsetCP437AMS2, str); + songMessage.Read(str.c_str(), str.length(), SongMessage::leAutodetect); } // Channel names @@ -962,8 +927,11 @@ textOut[writeLen++] = c; } } + std::string str; + std::copy(textOut.begin(), textOut.begin() + descriptionHeader.unpackedLen, std::back_inserter(str)); + str = mpt::To(mpt::CharsetCP437, mpt::CharsetCP437AMS2, str); // Packed text doesn't include any line breaks! - songMessage.ReadFixedLineLength(&textOut[0], descriptionHeader.unpackedLen, 74, 0, ConvertAMS2TextChars); + songMessage.ReadFixedLineLength(str.c_str(), str.length(), 74, 0); } // Read Order List Modified: trunk/OpenMPT/soundlib/Message.cpp =================================================================== --- trunk/OpenMPT/soundlib/Message.cpp 2013-12-05 15:47:00 UTC (rev 3378) +++ trunk/OpenMPT/soundlib/Message.cpp 2013-12-05 16:43:01 UTC (rev 3379) @@ -21,10 +21,9 @@ // [in] data: pointer to the data in memory that is going to be read // [in] length: number of characters that should be read, not including a possible trailing null terminator (it is automatically appended). // [in] lineEnding: line ending formatting of the text in memory. -// [in] pTextConverter: Pointer to a callback function which can be used to pre-process the read characters, if necessary (nullptr otherwise). // [out] returns true on success. -bool SongMessage::Read(const void *data, size_t length, LineEnding lineEnding, ConverterFunc pTextConverter) -//---------------------------------------------------------------------------------------------------------- +bool SongMessage::Read(const void *data, size_t length, LineEnding lineEnding) +//---------------------------------------------------------------------------- { const char *str = static_cast<const char *>(data); while(length != 0 && str[length - 1] == '\0') @@ -42,8 +41,6 @@ for(size_t i = 0; i < length; i++) { char c = str[i]; - if(pTextConverter != nullptr) - c = pTextConverter(c); if(c == '\r') nCR++; else if(c == '\n') nLF++; @@ -67,8 +64,6 @@ for(size_t i = 0; i < length; i++) { char c = str[i]; - if(pTextConverter != nullptr) - c = pTextConverter(c); if(c != '\n' || lineEnding != leCRLF) finalLength++; @@ -80,8 +75,6 @@ for(size_t i = 0; i < length; i++, cpos++) { char c = str[i]; - if(pTextConverter != nullptr) - c = pTextConverter(c); switch(c) { @@ -111,11 +104,11 @@ } -bool SongMessage::Read(FileReader &file, const size_t length, LineEnding lineEnding, ConverterFunc pTextConverter) -//---------------------------------------------------------------------------------------------------------------- +bool SongMessage::Read(FileReader &file, const size_t length, LineEnding lineEnding) +//---------------------------------------------------------------------------------- { FileReader::off_t readLength = std::min(static_cast<FileReader::off_t>(length), file.BytesLeft()); - bool success = Read(file.GetRawData(), readLength, lineEnding, pTextConverter); + bool success = Read(file.GetRawData(), readLength, lineEnding); file.Skip(readLength); return success; } @@ -126,10 +119,9 @@ // [in] length: number of characters that should be read, not including a possible trailing null terminator (it is automatically appended). // [in] lineLength: The fixed length of a line. // [in] lineEndingLength: The padding space between two fixed lines. (there could for example be a null char after every line) -// [in] pTextConverter: Pointer to a callback function which can be used to pre-process the read characters, if necessary (nullptr otherwise). // [out] returns true on success. -bool SongMessage::ReadFixedLineLength(const void *data, const size_t length, const size_t lineLength, const size_t lineEndingLength, ConverterFunc pTextConverter) -//---------------------------------------------------------------------------------------------------------------------------------------------------------------- +bool SongMessage::ReadFixedLineLength(const void *data, const size_t length, const size_t lineLength, const size_t lineEndingLength) +//---------------------------------------------------------------------------------------------------------------------------------- { const char *str = static_cast<const char *>(data); if(lineLength == 0) @@ -148,9 +140,6 @@ // fix weird chars for(size_t lpos = 0; lpos < lineLength; lpos++) { - // Pre-process text - if(pTextConverter != nullptr) at(cpos + lpos) = pTextConverter(at(cpos + lpos)); - switch(at(cpos + lpos)) { case '\0': @@ -166,11 +155,11 @@ } -bool SongMessage::ReadFixedLineLength(FileReader &file, const size_t length, const size_t lineLength, const size_t lineEndingLength, ConverterFunc pTextConverter) -//---------------------------------------------------------------------------------------------------------------------------------------------------------------- +bool SongMessage::ReadFixedLineLength(FileReader &file, const size_t length, const size_t lineLength, const size_t lineEndingLength) +//---------------------------------------------------------------------------------------------------------------------------------- { FileReader::off_t readLength = std::min(static_cast<FileReader::off_t>(length), file.BytesLeft()); - bool success = ReadFixedLineLength(file.GetRawData(), readLength, lineLength, lineEndingLength, pTextConverter); + bool success = ReadFixedLineLength(file.GetRawData(), readLength, lineLength, lineEndingLength); file.Skip(readLength); return success; } @@ -178,10 +167,9 @@ // Retrieve song message. // [in] lineEnding: line ending formatting of the text in memory. -// [in] pTextConverter: Pointer to a callback function which can be used to post-process the written characters, if necessary (nullptr otherwise). // [out] returns formatted song message. -std::string SongMessage::GetFormatted(const LineEnding lineEnding, ConverterFunc pTextConverter) const -//---------------------------------------------------------------------------------------------------- +std::string SongMessage::GetFormatted(const LineEnding lineEnding) const +//---------------------------------------------------------------------- { std::string comments; @@ -214,8 +202,6 @@ } else { char c = at(i); - // Pre-process text - if(pTextConverter != nullptr) c = pTextConverter(c); comments.at(writePos++) = c; } } Modified: trunk/OpenMPT/soundlib/Message.h =================================================================== --- trunk/OpenMPT/soundlib/Message.h 2013-12-05 15:47:00 UTC (rev 3378) +++ trunk/OpenMPT/soundlib/Message.h 2013-12-05 16:43:01 UTC (rev 3379) @@ -20,8 +20,6 @@ { public: - typedef char (*ConverterFunc)(char); - // Line ending types (for reading song messages from module files) enum LineEnding { @@ -41,24 +39,21 @@ // [in] data: pointer to the data in memory that is going to be read // [in] length: number of characters that should be read, not including a possible trailing null terminator (it is automatically appended). // [in] lineEnding: line ending formatting of the text in memory. - // [in] pTextConverter: Pointer to a callback function which can be used to pre-process the read characters, if necessary (nullptr otherwise). // [out] returns true on success. - bool Read(const void *data, const size_t length, LineEnding lineEnding, ConverterFunc pTextConverter = nullptr); - bool Read(FileReader &file, const size_t length, LineEnding lineEnding, ConverterFunc pTextConverter = nullptr); + bool Read(const void *data, const size_t length, LineEnding lineEnding); + bool Read(FileReader &file, const size_t length, LineEnding lineEnding); // Read comments with fixed line length from a mapped file. // [in] data: pointer to the data in memory that is going to be read // [in] length: number of characters that should be read, not including a possible trailing null terminator (it is automatically appended). // [in] lineLength: The fixed length of a line. // [in] lineEndingLength: The padding space between two fixed lines. (there could for example be a null char after every line) - // [in] pTextConverter: Pointer to a callback function which can be used to pre-process the read characters, if necessary (nullptr otherwise). // [out] returns true on success. - bool ReadFixedLineLength(const void *data, const size_t length, const size_t lineLength, const size_t lineEndingLength, ConverterFunc pTextConverter = nullptr); - bool ReadFixedLineLength(FileReader &file, const size_t length, const size_t lineLength, const size_t lineEndingLength, ConverterFunc pTextConverter = nullptr); + bool ReadFixedLineLength(const void *data, const size_t length, const size_t lineLength, const size_t lineEndingLength); + bool ReadFixedLineLength(FileReader &file, const size_t length, const size_t lineLength, const size_t lineEndingLength); // Retrieve song message. // [in] lineEnding: line ending formatting of the text in memory. - // [in] pTextConverter: Pointer to a callback function which can be used to post-process the written characters, if necessary (nullptr otherwise). // [out] returns formatted song message. - std::string GetFormatted(const LineEnding lineEnding, ConverterFunc pTextConverter = nullptr) const; + std::string GetFormatted(const LineEnding lineEnding) const; }; Modified: trunk/OpenMPT/soundlib/Tables.cpp =================================================================== --- trunk/OpenMPT/soundlib/Tables.cpp 2013-12-05 15:47:00 UTC (rev 3378) +++ trunk/OpenMPT/soundlib/Tables.cpp 2013-12-05 16:43:01 UTC (rev 3379) @@ -168,8 +168,8 @@ { MOD_TYPE_J2B , MOD_CHARSET_IS , mpt::CharsetCP437 }, { MOD_TYPE_IMF , MOD_CHARSET_IS , mpt::CharsetCP437 }, { MOD_TYPE_ULT , MOD_CHARSET_IS , mpt::CharsetCP437 }, - { MOD_TYPE_AMS , MOD_CHARSET_IS , mpt::CharsetWindows1252}, // We convert the custom AMS special character set to our own set. - { MOD_TYPE_AMS2, MOD_CHARSET_IS , mpt::CharsetWindows1252}, // ditto + { MOD_TYPE_AMS , MOD_CHARSET_IS , mpt::CharsetCP437 }, + { MOD_TYPE_AMS2, MOD_CHARSET_IS , mpt::CharsetCP437 }, { MOD_TYPE_DSM , MOD_CHARSET_IS , mpt::CharsetCP437 }, // Windows { MOD_TYPE_MT2 , MOD_CHARSET_MAYBE , mpt::CharsetWindows1252}, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |