multiply buffer size by MB_CUR_MAX so multi-byte chars fit