forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8d32717
committed
Avoid doing encoding conversions by double-conversion via MULE_INTERNAL.
Previously, we did many conversions for Cyrillic and Central Europeansingle-byte encodings by converting to a related MULE_INTERNAL codingscheme before converting to the destination. This seems unnecessarilyinefficient. Moreover, if the conversion encounters an untranslatablecharacter, the error message will confusingly complain about failureto convert to or from MULE_INTERNAL, rather than the user-visibleencodings. Worse still, this approach results in some completelyunnecessary conversion failures; there are cases where the chosenMULE subset lacks characters that exist in both of the user-visibleencodings, causing a conversion failure that need not occur.This patch fixes the first two of those deficiencies by introducinga new local2local() conversion support subroutine for direct conversionbetween any two single-byte character sets, and adding new conversiontables where needed. However, I generated the new conversion tables bytesting PG 9.5's behavior, so that the actual conversion behavior isbug-compatible with previous releases; the only user-visible behaviorchange is that the error messages for conversion failures are saner.Changes in the conversion behavior will probably ensue after discussion.Interestingly, although this approach requires more tables, the .so filesactually end up smaller (at least on my x86_64 machine); the tables aresmaller than the management code needed for double conversion.Per a complaint from Albe Laurenz.1 parent5afdfc9 commit8d32717
File tree
5 files changed
+376
-411
lines changed- src
- backend/utils/mb
- conversion_procs
- cyrillic_and_mic
- latin2_and_win1250
- latin_and_mic
- include/mb
5 files changed
+376
-411
lines changedLines changed: 50 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
17 | 62 |
| |
18 | 63 |
| |
19 | 64 |
| |
| |||
141 | 186 |
| |
142 | 187 |
| |
143 | 188 |
| |
144 |
| - | |
145 |
| - | |
| 189 | + | |
| 190 | + | |
146 | 191 |
| |
147 | 192 |
| |
148 | 193 |
| |
| |||
188 | 233 |
| |
189 | 234 |
| |
190 | 235 |
| |
191 |
| - | |
192 |
| - | |
193 |
| - | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
194 | 239 |
| |
195 | 240 |
| |
196 | 241 |
| |
|
0 commit comments
Comments
(0)