Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode input support #30

Open
googol4u opened this issue Aug 20, 2011 · 1 comment
Open

Unicode input support #30

googol4u opened this issue Aug 20, 2011 · 1 comment

Comments

@googol4u
Copy link

Hi, Guys,

Thanks you for your great efforts to develop this tools. It makes remote management of databases possible.

However, some times we need to input Chinese to make some queries. It seems that henplus can not process Unicode characters correctly.

We use set-var to do the test.
Hen*Plus> set-var HELLO 你好

then we read the 'setting' file in .henplus folder, it turns out to be:

HELLO=\u00E4\u00BD\u00A0\u00E5\u00A5\u00BD

actually, there are two characters that we have just inputed. the correct setting should be:

HELLO=\u4f60\u597d

seems that the inputed unicode charaters have been converted into byte array.

Any work around for this issue?

@evgeny-gridasov
Copy link

Hi
I came across this issue like a couple of years ago and the workaround is in patching java readline library.
It is a dirty hack but this is what works for me:

diff -Naur ./src/native/org_gnu_readline_Readline.c ../../libreadline-java-0.8.0/src/native/org_gnu_readline_Readline.c
--- ./src/native/org_gnu_readline_Readline.c    2003-01-07 20:14:35.000000000 +1000
+++ ../../libreadline-java-0.8.0/src/native/org_gnu_readline_Readline.c 2010-07-28 16:20:37.433083185 +1000
@@ -576,6 +576,8 @@
       return NULL;
   }

+  strcpy(buffer, utf8); return buffer;
+
   for (i=0,pin=utf8,pout=buffer; i<bufLength && *pin; i++,pin++,pout++) {
     current = *pin;
     if (current >= 0xE0) {                   /* we support only two-byte utf8 */
@@ -613,6 +615,8 @@
       return NULL;
   }

+  strcpy(buffer, ucs); return buffer;
+
   for (i=0,pin=ucs,pout=buffer; i<bufLength && *pin; i++,pin++,pout++) {
     current = *pin;
     if (current < 0x80)                      /* one-byte utf8                 */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants