--- configure.ac 1 Aug 2005 09:54:56 -0000 1.37 +++ configure.ac 15 Aug 2005 18:22:36 -0000 @@ -2063,6 +2063,37 @@ int ptsname();], , fi fi +dnl --------------------- +dnl multibyte ZLE support +dnl --------------------- +AC_ARG_ENABLE(multibyte, +[ --enable-multibyte support multibyte chars in the zsh line editor], +[zsh_cv_c_zle_unicode_support=$enableval], +[AC_CACHE_CHECK(if the system adequately supports multibyte chars, + zsh_cv_c_zle_unicode_support, + [AC_TRY_COMPILE([ +#ifdef HAVE_LOCALE_H +# include +#endif + ], [ +int main() { +#if defined(HAVE_WCHAR_H) && defined(HAVE_WCTOMB) \ + && defined(HAVE_MBRTOWC) && defined(HAVE_WCRTOMB) \ + && defined (__STDC_ISO_10646__) + return 0; +#else +# error Not supported. +#endif +} + ], + zsh_cv_c_zle_unicode_support=yes, + zsh_cv_c_zle_unicode_support=no)]) +]) +AH_TEMPLATE([ZLE_UNICODE_SUPPORT], +[Define to 1 if you want unicode support in the line editor.]) +if test $zsh_cv_c_zle_unicode_support = yes; then + AC_DEFINE(ZLE_UNICODE_SUPPORT) +fi dnl --------------- dnl dynamic loading --- Src/system.h 15 Aug 2005 10:01:48 -0000 1.33 +++ Src/system.h 15 Aug 2005 18:22:36 -0000 @@ -692,21 +692,17 @@ extern short ospeed; #endif /* - * This is a subset of ZLE_UNICODE_SUPPORT. It is not all that likely - * that only the subset is supported, however it's easy to make the - * \u and \U escape sequences work with just the following. + * The ZLE_UNICODE_SUPPORT configure-define specifies that we want to enable + * complete Unicode conversion between wide characters and multibyte strings. */ -#if defined(HAVE_WCHAR_H) && defined(HAVE_WCTOMB) && defined (__STDC_ISO_10646__) -# include -# include - +#if defined ZLE_UNICODE_SUPPORT \ + || (defined HAVE_WCHAR_H && defined HAVE_WCTOMB && defined __STDC_ISO_10646__) /* - * More stringent requirements to enable complete Unicode conversion - * between wide characters and multibyte strings. + * If ZLE_UNICODE_SUPPORT is not defined, these includes provide a subset of + * Unicode support that makes the \u and \U printf escape sequences work. */ -#if defined(HAVE_MBRTOWC) && defined(HAVE_WCRTOMB) -#define ZLE_UNICODE_SUPPORT 1 -#endif +# include +# include #else # ifdef HAVE_LANGINFO_H # include