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
raw_input problem with readline and UTF8 #41445
Comments
Backspace doesn't remove all bytes of a multi-byte To reproduce the problem:
$ export LANG=en_US.UTF-8
$ python
Python 2.3.4 (#1, Jun 11 2004, 16:35:29)
[GCC 3.3.3 20040412 (Gentoo Linux 3.3.3-r3, ssp-3.3-7,
pie-8.5.3)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> import readline
>>> raw_input() # ä, return
ä
'\xc3\xa4'
>>> raw_input() # ä, backspace, return '\xc3'
A small C program does not have the same problem: #include <stdlib.h>
#include <stdio.h>
#include <readline/readline.h>
#include <readline/history.h>
void pprint(const char *s);
int main(void) {
char *line;
for (;;) {
line = readline("> ");
if (!line)
break;
pprint(line);
free(line);
}
return 0;
}
void pprint(const char *s) {
while (*s) {
if (isprint(*s))
putchar(*s);
else
printf("\\x%x", *s & 0xff);
s++;
}
putchar('\n');
} |
Logged In: YES Hi, it looks like this might be the same problem already Also, you could check if python's readline.so is linked to |
Logged In: YES Is this still relavent? |
Please close this, reportedly fixed and no further info from OP. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: