* @brief Sanity check file's specified codepage. * This function checks if file's specified codepage is valid for WinMerge * editor and if not resets the codepage to default. * @param [in,out] fileinfo Class containing file's codepage. */
| 2106 | * @param [in,out] fileinfo Class containing file's codepage. |
| 2107 | */ |
| 2108 | void CMergeDoc::SanityCheckCodepage(FileLocation & fileinfo) |
| 2109 | { |
| 2110 | if (fileinfo.encoding.m_unicoding == ucr::NONE |
| 2111 | && !IsValidCodepageForMergeEditor(fileinfo.encoding.m_codepage)) |
| 2112 | { |
| 2113 | int cp = ucr::getDefaultCodepage(); |
| 2114 | if (!IsValidCodepageForMergeEditor(cp)) |
| 2115 | cp = CP_ACP; |
| 2116 | fileinfo.encoding.SetCodepage(cp); |
| 2117 | } |
| 2118 | } |
| 2119 | |
| 2120 | /** |
| 2121 | * @brief Loads one file from disk and updates file infos. |
nothing calls this directly
no test coverage detected