localcharset: work around Mac OS X bug with UTF-8 and MB_CUR_MAX