* fetch maximum length of a given encoding */
| 2023 | * fetch maximum length of a given encoding |
| 2024 | */ |
| 2025 | int |
| 2026 | pg_encoding_max_length(int encoding) |
| 2027 | { |
| 2028 | Assert(PG_VALID_ENCODING(encoding)); |
| 2029 | |
| 2030 | /* |
| 2031 | * Check for the encoding despite the assert, due to some mingw versions |
| 2032 | * otherwise issuing bogus warnings. |
| 2033 | */ |
| 2034 | return PG_VALID_ENCODING(encoding) ? |
| 2035 | pg_wchar_table[encoding].maxmblen : |
| 2036 | pg_wchar_table[PG_SQL_ASCII].maxmblen; |
| 2037 | } |
no outgoing calls