Ticket #73 (closed defect: fixed)

Opened 20 months ago

Last modified 18 months ago

International characters cannot be entered into bbackupquery

Reported by: chris Owned by: chris
Priority: normal Milestone: 0.12
Component: bbackupd Version: trunk
Keywords: international characters charset unicode libedit editline readline i18n bbackupquery debian ubuntu Cc:

Description (last modified by chris) (diff)

When bbackupquery is linked to libedit, which seems to be the default on some Linux distributions (e.g. Debian and Ubuntu), it runs into a bug in libedit's support for international characters. libedit refuses to allow international characters to be entered at the prompt.

I've investigated the problem and I'm fairly confident (without debugging down to the exact lines in libedit) that this is the problem:

 http://marc.info/?l=netbsd-users&m=119056066913928&w=2

Specifically, libedit "will have problems with UTF-8 and multibyte character sets, because it reads characters from the terminal one byte at a time, and checks them bytewise for printability."

This works on FreeBSD but not on Linux, due to differences in the locale tables. FreeBSD lists some of the bytes 0x80 to 0xfd as printable, which allows Unicode to be entered bytewise, wherease Linux does not, at least on by Ubuntu system. This causes libedit to reject the characters. So this bug probably affects Linux systems, but not FreeBSD.

I can't see modifying the locale tables as a useful workaround, and switching the character set to ISO-8859-1 also does not solve the problem (some characters can be entered, but others cannot). However you might find that the following is a partial workaround on your system:

LC_ALL=de_DE.ISO8859-1 bbackupquery ...

Another workaround is to use the command line to enter the directory that you want:

bbackupquery "cd location/path/with/umlauts-öäüÖÄÜß"

Otherwise, libedit needs to be disabled or fixed in order to properly support international characters, or readline must be used instead. Disabling it removes other functionality, so this is a difficult choice to make, but I think it makes sense to disable it (at least by default) on Linux systems.

Using readline was not previously an option because of license conflicts. I think that even though Box Backup is now dual-licensed, there may still be a conflict in linking both GPL readline and non-GPL OpenSSL into the same binary, so Debian probably would not accept a switch to readline as a solution.

I've looked into fixing libedit and it's definitely not trivial. I started to "look at the tcsh code (where the editline code was created from) and copy the changes," but the whole of tcsh was converted to use wide character strings at the same time, which would break backwards compatibility with existing applications if applied directly to libedit.

I'm considering adding a command-line switch to bbackupquery to disable readline/editline, and/or doing it automatically if the locale tables don't appear to support entering Unicode characters.

In the mean time I recommend that international users of bbackupquery build their binaries from source (rather than using their distribution's binary package) and link to readline instead of editline, by passing the --enable-gnu-readline option to the ./configure script, and treat the resulting binary as covered by the GPL alone.

Change History

comment:1 Changed 20 months ago by chris

  • Description modified (diff)

comment:2 Changed 20 months ago by chris

  • Description modified (diff)

comment:3 Changed 20 months ago by chris

  • Status changed from new to assigned
  • Owner changed from ben to chris

comment:4 Changed 18 months ago by chris

  • Status changed from assigned to closed
  • Resolution set to fixed

I have no plans to fix libedit. I started work on it, but the changes between tcsh's built-in libedit (which supports multibyte characters) and the standalone libedit (which does not) are too extensive, would require more work than I'm prepared to invest right now, and would break the backwards compatibility of libedit, so it would be hard to get merged.

You can now work around this with the -E command-line option to trunk bbackupquery that disables editline support. This didn't make it into 0.11 final, but should be in 0.11.1 (if any) or 0.12.

Note: See TracTickets for help on using tickets.