getEncoding function

dynamic getEncoding(
  1. dynamic platformID,
  2. dynamic encodingID,
  3. dynamic languageID
)

Implementation

getEncoding(platformID, encodingID, languageID) {
    switch (platformID) {
        case 0:  // Unicode
            return utf16;

        case 1:  // Apple Macintosh
            return macLanguageEncodings[languageID] ?? macScriptEncodings[encodingID];

        case 3:  // Microsoft Windows
            if (encodingID == 1 || encodingID == 10) {
                return utf16;
            }

            break;
    }

    return null;
}