I'm using GNU dialog in one of my lengthy shell scripts. One of the areas I've got problems with is when I'm asking for an inputBox where the user can type a book's title, mostly in French.

In this inputBox, entering accented characters (éàè are very common in French), or special UTF-8 characters such as the em-dash "—" shifts the cursor 4 characters right, instead of one. After 3 or 4 "special" characters, the inputbox is completely unusable because of this artifact.

Similarly, when I display a menu with dialog, accented characters shift the right border of the dialog box. That's less handicapping than in the inputBox, but yet it's a visual discomfort.

This actually solved another problem for me: the borders of the windows were displayed using letters instead of linedraw characters. Using NCURSES_NO_UTF8_ACS solves the issue. Thanks!
– AleNov 11 '15 at 21:14

Make sure your terminal is in UTF-8 mode. If you are setting the locale variables from your ~/.bashrc as some do, then they will apply to the shell, but not to its parent terminal. Use tr \\0 \\n </proc/$PPID/environ to check whether the terminal has the same locale variables. (Some (such as GNOME Terminal) have an explicit character encoding menu, which you can use instead.)

Also, make sure the locale is listed by locale -a – if it is not, edit /etc/locale.gen and run locale-gen as root.

Note that it is not recommended to set LC_ALL unless necessary, as this makes overriding the more-specific variables impossible. Just LANG is enough

I don't have a /proc, as I'm on a Mac for iOS development. Whether I'm using iTerm2 (my default terminal) or Mac OS's standard Terminal, dialog exhibits this behavior. And my fr_FR.UTF-8 is correctly listed under locale -a.
– CyrilleSep 8 '11 at 20:06

... (continued) but in iTerm2's settings, "Terminal Emulation > Character Encoding" is correctly set to "Unicode (UTF-8)".
– CyrilleSep 8 '11 at 20:06

Actually, my terminal works great when in bash or vi — I can enter accented characters and it does not mess with them. Only dialog produces this problem. Could it be a problem in ncurses' configuration?
– CyrilleSep 9 '11 at 13:21