Add a pg_encoding_mbcliplen() function that is just like pg_mbcliplen()
Tom Lane <tgl@sss.pgh.pa.us>
Add a pg_encoding_mbcliplen() function that is just like pg_mbcliplen() except the caller can specify the encoding to work in; this will be needed for pg_stat_statements. In passing, do some marginal efficiency hacking and clean up some comments. Also, prevent the single-byte-encoding code path from fetching one byte past the stated length of the string (this last is a bug that might need to be back-patched at some point).
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/mb/mbutils.c | modified | +35 −22 |
| src/include/mb/pg_wchar.h | modified | +3 −1 |