256
257
258
259
260
261
262
263
264
265
266
267
268
269
|
- (void)testStringWithCStringEncodingISO8859_15
{
OTAssertEqualObjects([self.stringClass
stringWithCString: "\xA4\xA6\xA8\xB4\xB8\xBC\xBD\xBE"
encoding: OFStringEncodingISO8859_15], @"€ŠšŽžŒœŸ");
}
#endif
#ifdef HAVE_WINDOWS_1252
- (void)testStringWithCStringEncodingWindows1252
{
OTAssertEqualObjects([self.stringClass
stringWithCString: "\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B"
"\x8C\x8E\x91\x92\x93\x94\x95\x96\x97\x98\x99"
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
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
|
- (void)testStringWithCStringEncodingISO8859_15
{
OTAssertEqualObjects([self.stringClass
stringWithCString: "\xA4\xA6\xA8\xB4\xB8\xBC\xBD\xBE"
encoding: OFStringEncodingISO8859_15], @"€ŠšŽžŒœŸ");
}
#endif
#ifdef HAVE_WINDOWS_1250
- (void)testStringWithCStringEncodingWindows1250
{
OTAssertEqualObjects([self.stringClass
stringWithCString: "\x80\x82\x84\x85\x86\x87\x89\x8A"
"\x8B\x8C\x8D\x8E\x8F\x91\x92\x93"
"\x94\x95\x96\x97\x99\x9A\x9B\x9C"
"\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4"
"\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC"
"\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4"
"\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC"
"\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4"
"\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC"
"\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4"
"\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC"
"\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4"
"\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC"
"\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4"
"\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC"
"\xFD\xFE\xFF"
encoding: OFStringEncodingWindows1250],
@"€‚„…†‡‰Š‹ŚŤŽŹ‘’“”•–—™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄ"
@"ĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙");
}
#endif
#ifdef HAVE_WINDOWS_1252
- (void)testStringWithCStringEncodingWindows1252
{
OTAssertEqualObjects([self.stringClass
stringWithCString: "\x80\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B"
"\x8C\x8E\x91\x92\x93\x94\x95\x96\x97\x98\x99"
|
329
330
331
332
333
334
335
336
337
338
339
340
341
342
|
OTAssertThrowsSpecific(
[[self.stringClass stringWithString: @"This is ä t€st…"]
cStringWithEncoding: OFStringEncodingISO8859_15],
OFInvalidEncodingException);
}
#endif
#ifdef HAVE_WINDOWS_1252
- (void)testCStringWithEncodingWindows1252
{
OTAssertEqual(
strcmp([[self.stringClass stringWithString: @"This is ä t€st…"]
cStringWithEncoding: OFStringEncodingWindows1252],
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
|
OTAssertThrowsSpecific(
[[self.stringClass stringWithString: @"This is ä t€st…"]
cStringWithEncoding: OFStringEncodingISO8859_15],
OFInvalidEncodingException);
}
#endif
#ifdef HAVE_WINDOWS_1250
- (void)testCStringWithEncodingWindows1250
{
OTAssertEqual(
strcmp([[self.stringClass stringWithString:
@"€‚„…†‡‰Š‹ŚŤŽŹ‘’“”•–—™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄ"
@"ĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"]
cStringWithEncoding: OFStringEncodingWindows1250],
"\x80\x82\x84\x85\x86\x87\x89\x8A\x8B\x8C\x8D\x8E\x8F\x91\x92\x93"
"\x94\x95\x96\x97\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4"
"\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4"
"\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4"
"\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1\xD2\xD3\xD4"
"\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\xDE\xDF\xE0\xE1\xE2\xE3\xE4"
"\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4"
"\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"), 0);
OTAssertThrowsSpecific(
[[self.stringClass stringWithString: @"This is ä t€st…‼"]
cStringWithEncoding: OFStringEncodingWindows1250],
OFInvalidEncodingException);
}
#endif
#ifdef HAVE_WINDOWS_1252
- (void)testCStringWithEncodingWindows1252
{
OTAssertEqual(
strcmp([[self.stringClass stringWithString: @"This is ä t€st…"]
cStringWithEncoding: OFStringEncodingWindows1252],
|
384
385
386
387
388
389
390
391
392
393
394
395
396
397
|
{
OTAssertEqual(
strcmp([[self.stringClass stringWithString: @"This is ä t€st…"]
lossyCStringWithEncoding: OFStringEncodingISO8859_15],
"This is \xE4 t\xA4st?"), 0);
}
#endif
#ifdef HAVE_WINDOWS_1252
- (void)testLossyCStringWithEncodingWindows1252
{
OTAssertEqual(
strcmp([[self.stringClass stringWithString: @"This is ä t€st…‼"]
lossyCStringWithEncoding: OFStringEncodingWindows1252],
|
>
>
>
>
>
>
>
>
>
>
|
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
|
{
OTAssertEqual(
strcmp([[self.stringClass stringWithString: @"This is ä t€st…"]
lossyCStringWithEncoding: OFStringEncodingISO8859_15],
"This is \xE4 t\xA4st?"), 0);
}
#endif
#ifdef HAVE_WINDOWS_1250
- (void)testLossyCStringWithEncodingWindows1250
{
OTAssertEqual(
strcmp([[self.stringClass stringWithString: @"This is ä t€st…‼"]
lossyCStringWithEncoding: OFStringEncodingWindows1250],
"This is \xE4 t\x80st\x85?"), 0);
}
#endif
#ifdef HAVE_WINDOWS_1252
- (void)testLossyCStringWithEncodingWindows1252
{
OTAssertEqual(
strcmp([[self.stringClass stringWithString: @"This is ä t€st…‼"]
lossyCStringWithEncoding: OFStringEncodingWindows1252],
|