Overview
Comment: | Add codepage 850 |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
878c25c9d7426c8cbe90e77a818d89e2 |
User & Date: | js on 2017-01-10 21:38:03 |
Other Links: | manifest | tags |
Context
2017-01-10
| ||
23:23 | Add Mac OS Roman encoding check-in: 0832fcf579 user: js tags: trunk | |
21:38 | Add codepage 850 check-in: 878c25c9d7 user: js tags: trunk | |
19:58 | OFLocalization: Properly lowercase the language check-in: 0f2ed1e510 user: js tags: trunk | |
Changes
Modified src/Makefile from [143a1e3a3b] to [a953a0f2ce].
︙ | |||
150 151 152 153 154 155 156 157 158 159 160 161 162 163 | 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 | + | OFMutableDictionary_hashtable.m \ OFMutableSet_hashtable.m \ OFMutableString_UTF8.m \ OFSet_hashtable.m \ OFString_UTF8.m \ ${AUTORELEASE_M} \ codepage_437.m \ codepage_850.m \ ${FOUNDATION_COMPAT_M} \ ${INSTANCE_M} \ iso_8859_15.m \ ${UNICODE_M} \ windows_1252.m SRCS_FILES += OFSettings_INIFile.m SRCS_SOCKETS += ${OFKERNELEVENTOBSERVER_EPOLL_M} \ |
︙ |
Modified src/OFString.h from [79bdbf48d8] to [ffba6d3d70].
︙ | |||
60 61 62 63 64 65 66 67 68 69 70 71 72 73 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | + + | OF_STRING_ENCODING_ISO_8859_1, /*! ISO 8859-15 */ OF_STRING_ENCODING_ISO_8859_15, /*! Windows-1252 */ OF_STRING_ENCODING_WINDOWS_1252, /*! Codepage 437 */ OF_STRING_ENCODING_CODEPAGE_437, /*! Codepage 850 */ OF_STRING_ENCODING_CODEPAGE_850, /*! Try to automatically detect the encoding */ OF_STRING_ENCODING_AUTODETECT = 0xFF } of_string_encoding_t; enum { OF_STRING_SEARCH_BACKWARDS = 1, OF_STRING_SKIP_EMPTY = 2 |
︙ |
Modified src/OFString.m from [0f58e25244] to [f0fd5cc4db].
︙ | |||
91 92 93 94 95 96 97 98 99 100 101 102 103 104 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | + + | extern bool of_unicode_to_iso_8859_15(const of_unichar_t*, uint8_t*, size_t, bool); extern bool of_unicode_to_windows_1252(const of_unichar_t*, uint8_t*, size_t, bool); extern bool of_unicode_to_codepage_437(const of_unichar_t*, uint8_t*, size_t, bool); extern bool of_unicode_to_codepage_850(const of_unichar_t*, uint8_t*, size_t, bool); /* References for static linking */ void _references_to_categories_of_OFString(void) { _OFString_CryptoHashing_reference = 1; _OFString_JSONValue_reference = 1; |
︙ | |||
1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 | 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 | + + + + + + + + + + + | if (!of_unicode_to_codepage_437(characters, (uint8_t*)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; case OF_STRING_ENCODING_CODEPAGE_850: if (length + 1 > maxLength) @throw [OFOutOfRangeException exception]; if (!of_unicode_to_codepage_850(characters, (uint8_t*)cString, length, lossy)) @throw [OFInvalidEncodingException exception]; cString[length] = '\0'; return length; default: @throw [OFNotImplementedException exceptionWithSelector: _cmd object: self]; } } |
︙ | |||
1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 | 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 | + | break; case OF_STRING_ENCODING_ASCII: case OF_STRING_ENCODING_ISO_8859_1: case OF_STRING_ENCODING_ISO_8859_15: case OF_STRING_ENCODING_WINDOWS_1252: case OF_STRING_ENCODING_CODEPAGE_437: case OF_STRING_ENCODING_CODEPAGE_850: cString = [object allocMemoryWithSize: length + 1]; [self OF_getCString: cString maxLength: length + 1 encoding: encoding lossy: lossy]; |
︙ | |||
1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 | 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 | + | return UTF8StringLength; case OF_STRING_ENCODING_ASCII: case OF_STRING_ENCODING_ISO_8859_1: case OF_STRING_ENCODING_ISO_8859_15: case OF_STRING_ENCODING_WINDOWS_1252: case OF_STRING_ENCODING_CODEPAGE_437: case OF_STRING_ENCODING_CODEPAGE_850: return [self length]; default: @throw [OFInvalidEncodingException exception]; } } - (size_t)UTF8StringLength |
︙ |
Modified src/OFString_UTF8.m from [432a4769a5] to [fdc7ecf620].
︙ | |||
37 38 39 40 41 42 43 44 45 46 47 48 49 50 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | + | #import "of_asprintf.h" #import "unicode.h" extern const of_char16_t of_iso_8859_15[128]; extern const of_char16_t of_windows_1252[128]; extern const of_char16_t of_codepage_437[128]; extern const of_char16_t of_codepage_850[128]; static inline int memcasecmp(const char *first, const char *second, size_t length) { for (size_t i = 0; i < length; i++) { unsigned char f = first[i]; unsigned char s = second[i]; |
︙ | |||
290 291 292 293 294 295 296 297 298 299 300 301 302 303 | 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 | + + + | table = of_iso_8859_15; break; case OF_STRING_ENCODING_WINDOWS_1252: table = of_windows_1252; break; case OF_STRING_ENCODING_CODEPAGE_437: table = of_codepage_437; break; case OF_STRING_ENCODING_CODEPAGE_850: table = of_codepage_850; break; default: @throw [OFInvalidEncodingException exception]; } j = 0; for (size_t i = 0; i < cStringLength; i++) { |
︙ |
Added src/codepage_850.m version [f036557b58].