forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0d32342
committed
Teach the regular expression functions to do case-insensitive matching and
locale-dependent character classification properly when the database encodingis UTF8.The previous coding worked okay in single-byte encodings, or in any case forASCII characters, but failed entirely on multibyte characters. The fixassumes that the <wctype.h> functions use Unicode code points as the wcharrepresentation for Unicode, ie, wchar matches pg_wchar.This is only a partial solution, since we're still stupid about non-ASCIIcharacters in multibyte encodings other than UTF8. The practical effectof that is limited, however, since those cases are generally Far Easternglyphs for which concepts like case-folding don't apply anyway. Certainlyall or nearly all of the field reports of problems have been about UTF8.A more general solution would require switching to the platform's wcharrepresentation for all regex operations; which is possible but would havesubstantial disadvantages. Let's try this and see if it's sufficient inpractice.1 parentef51395 commit0d32342
2 files changed
+117
-14
lines changedLines changed: 105 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
50 |
| - | |
| 50 | + | |
51 | 51 |
| |
52 | 52 |
| |
53 | 53 |
| |
| |||
349 | 349 |
| |
350 | 350 |
| |
351 | 351 |
| |
| 352 | + | |
352 | 353 |
| |
353 |
| - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
354 | 368 |
| |
| 369 | + | |
355 | 370 |
| |
356 | 371 |
| |
357 | 372 |
| |
358 |
| - | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
359 | 381 |
| |
360 | 382 |
| |
361 | 383 |
| |
362 | 384 |
| |
363 | 385 |
| |
364 |
| - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
365 | 394 |
| |
366 | 395 |
| |
367 | 396 |
| |
368 | 397 |
| |
369 | 398 |
| |
370 |
| - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
371 | 407 |
| |
372 | 408 |
| |
373 | 409 |
| |
374 | 410 |
| |
375 | 411 |
| |
376 |
| - | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
377 | 420 |
| |
378 | 421 |
| |
379 | 422 |
| |
380 | 423 |
| |
381 | 424 |
| |
382 |
| - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
383 | 433 |
| |
384 | 434 |
| |
385 | 435 |
| |
386 | 436 |
| |
387 | 437 |
| |
388 |
| - | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
389 | 446 |
| |
390 | 447 |
| |
391 | 448 |
| |
392 | 449 |
| |
393 | 450 |
| |
394 |
| - | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
395 | 459 |
| |
396 | 460 |
| |
397 | 461 |
| |
398 | 462 |
| |
399 | 463 |
| |
400 |
| - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
401 | 472 |
| |
402 | 473 |
| |
403 | 474 |
| |
404 | 475 |
| |
405 | 476 |
| |
406 |
| - | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
407 | 485 |
| |
408 | 486 |
| |
409 | 487 |
| |
410 | 488 |
| |
411 | 489 |
| |
412 |
| - | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
413 | 498 |
| |
414 | 499 |
| |
415 | 500 |
| |
416 | 501 |
| |
417 | 502 |
| |
418 | 503 |
| |
419 | 504 |
| |
420 |
| - | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
421 | 513 |
| |
422 | 514 |
| |
423 | 515 |
| |
|
Lines changed: 12 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
28 |
| - | |
| 28 | + | |
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
37 | 48 |
| |
38 | 49 |
| |
39 | 50 |
| |
|
0 commit comments
Comments
(0)