1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-18 03:46:03 +00:00

Fix Unicode environemnt detection

Fix reading unicode lines
More work is needed for part of the readline compatibility, this is good enough
for the sqlite shell to accept unicode but not for ruby's irb yet
This commit is contained in:
Baptiste Daroussin 2015-01-07 22:44:04 +00:00
parent 2fb0b6f329
commit cf8b244f11
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=376504
3 changed files with 28 additions and 0 deletions

View File

@ -4,6 +4,7 @@
PORTNAME= libedit
PORTVERSION= ${EDITVERSION}.${EDITDATE}
DISTVERSION= ${EDITDATE}-${EDITVERSION}
PORTREVISION= 1
CATEGORIES= devel
MASTER_SITES= http://thrysoee.dk/editline/

View File

@ -0,0 +1,11 @@
--- src/el.c.orig 2014-06-18 19:06:35 UTC
+++ src/el.c
@@ -121,7 +121,7 @@ el_init_fd(const char *prog, FILE *fin,
*/
el->el_flags = 0;
#ifdef WIDECHAR
- if (setlocale(LC_CTYPE, NULL) != NULL){
+ if (setlocale(LC_CTYPE, "") != NULL){
if (strcmp(nl_langinfo(CODESET), "UTF-8") == 0)
el->el_flags |= CHARSET_IS_UTF8;
}

View File

@ -0,0 +1,16 @@
--- src/eln.c.orig 2015-01-07 22:26:24 UTC
+++ src/eln.c
@@ -76,9 +76,11 @@ el_gets(EditLine *el, int *nread)
{
const wchar_t *tmp;
- el->el_flags |= IGNORE_EXTCHARS;
+ if (!(el->el_flags & CHARSET_IS_UTF8))
+ el->el_flags |= IGNORE_EXTCHARS;
tmp = el_wgets(el, nread);
- el->el_flags &= ~IGNORE_EXTCHARS;
+ if (!(el->el_flags & CHARSET_IS_UTF8))
+ el->el_flags &= ~IGNORE_EXTCHARS;
return ct_encode_string(tmp, &el->el_lgcyconv);
}