• Teodor Sigaev's avatar
    Fix usage of char2wchar/wchar2char. Changes: · 32032d42
    Teodor Sigaev authored
    - pg_wchar and wchar_t could have different size, so char2wchar
      doesn't call pg_mb2wchar_with_len to prevent out-of-bound
      memory bug
    - make char2wchar/wchar2char symmetric, now they should not be
      called with C-locale because mbstowcs/wcstombs oftenly doesn't
      work correct with C-locale.
    - Text parser uses pg_mb2wchar_with_len directly in case of
      C-locale and multibyte encoding
    
    Per bug report by Hiroshi Inoue <inoue@tpf.co.jp> and
    following discussion.
    
    Backpatch up to 8.2 when multybyte support was implemented in tsearch.
    32032d42
wparser_def.c 59.8 KB