Overview
Comment: | Add support for C strings encoded in ISO 8859-15. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
0ea758cd9c3b327b79990d6503b2bc3f |
User & Date: | js on 2009-07-20 18:39:51 |
Other Links: | manifest | tags |
Context
2009-07-20
| ||
23:20 | Add support for C strings encoded in Windows-1252. check-in: e04c359780 user: js tags: trunk | |
18:39 | Add support for C strings encoded in ISO 8859-15. check-in: 0ea758cd9c user: js tags: trunk | |
2009-07-19
| ||
20:39 | Add -[xmlParser:foundUnknownEntityNamed:] to OFXMLParserDelegate. check-in: 83c351c9fd user: js tags: trunk | |
Changes
Modified src/OFString.h from [3f6a6e3d31] to [d669b9c0c5].
︙ | |||
13 14 15 16 17 18 19 | 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | - + + | #include <stdarg.h> #import "OFObject.h" #import "OFArray.h" enum of_string_encoding { OF_STRING_ENCODING_UTF_8, |
︙ |
Modified src/OFString.m from [2a8be01528] to [472df8f045].
︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | + + | #import "OFString.h" #import "OFAutoreleasePool.h" #import "OFExceptions.h" #import "OFMacros.h" #import "asprintf.h" #import "encodings/iso_8859_15.h" /* References for static linking */ void _references_to_categories_of_OFString() { _OFHashing_reference = 1; _OFURLEncoding_reference = 1; _OFXMLElement_reference = 1; |
︙ | |||
245 246 247 248 249 250 251 252 | 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | + + + + + - + + - + + + + + + + + + + + + + + - + - - - - - - + + + + + + + + + + + + - - + + + + + + + - + - + - - + + + + + + + - + | switch (encoding) { case OF_STRING_ENCODING_UTF_8: switch (of_string_check_utf8(str, length)) { case 1: is_utf8 = YES; break; case -1: /* * We can't use [super dealloc] on OS X here. * Compiler bug? Anyway, [self dealloc] will do here as * we don't reimplement dealloc. */ c = isa; |
︙ |
Added src/encodings/iso_8859_15.h version [2ef850307a].
|
Modified tests/OFString/OFString.m from [3c317544a3] to [74ea65afd6].
︙ | |||
20 21 22 23 24 25 26 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | - + | #ifndef _WIN32 #define ZD "%zd" #else #define ZD "%u" #endif |
︙ | |||
115 116 117 118 119 120 121 122 123 124 125 126 127 128 | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | + + + + | CHECK([[s1 reverse] isEqual: @"πβ¬ΓΌΓΆΓ€"]) [s1 dealloc]; /* ISO-8859-1 tests */ CHECK([[OFString stringWithCString: "\xE4\xF6\xFC" encoding: OF_STRING_ENCODING_ISO_8859_1] isEqual: @"Àâü"]) CHECK([[OFString stringWithCString: "\xA4\xA6\xA8\xB4\xB8\xBC\xBD\xBE" encoding: OF_STRING_ENCODING_ISO_8859_15] isEqual: @"β¬Ε Ε‘Ε½ΕΎΕΕΕΈ"]) /* Format tests */ s1 = [OFMutableString stringWithFormat: @"%s: %d", "test", 123]; CHECK([s1 isEqual: @"test: 123"]) [s1 appendWithFormat: @"%02X", 15]; CHECK([s1 isEqual: @"test: 1230F"]) |
︙ |