Public bug reported: I'm writing C applications for Ubuntu and I've find out interesting bug. That's a short program showing what's wrong. It reads a line from user and writes that line.
"#include <stdio.h> void main() { char buffer[1024]; for (;;) { fgets(buffer, sizeof buffer-1, stdin); printf("%s\n", buffer); } }" When I'm using a gnome-terminal with UTF-8 encoding, if I write in this program a string "Hello!", then delete it all with Backspace, than press Enter, I'll see: program have red an empty string, as expected. Then I write "123", delete it, press Enter and see: program have red an empty string, as expected. But if I write a string on russian, for example "Привет!", delete it all and press Enter, i'll see that program had red a string "Пр". If after full deletion of "Привет!" I write a string "123", it will show "При123". And this problem is happening with any Unicode russian string, that need to be edited, even if you want to replace only one symbol: say, I'm enter "Привед", delete one character and press "т" to change it to "Привет" - than program says it red a string "Приве�т". There's no such problems if I enter strings which contain only english letters and/or numbers. There's no such problem if I use any other encoding, which can be selected in gnome-terminal menu: KOI8R, WINDOWS1251, ISO-8859-5. I didn't noticed such problem on both XTerm an UXTerm, probably because they're don't using Unicode; there's also no such problem on LXTerminal, XTerm and UXTerm on my other machine running Lubuntu, probably by the same reason. Thanks you very much in advance for any efforts to solve this issue. System info: > lsb_release -rd Description: Ubuntu 14.04.1 LTS Release: 14.04 > apt-cache policy gnome-terminal gnome-terminal: Установлен (Installed): 3.6.2-0ubuntu1 Кандидат (Candidate): 3.6.2-0ubuntu1 Таблица версий (Table of versions): *** 3.6.2-0ubuntu1 0 500 http://ru.archive.ubuntu.com/ubuntu/ trusty/main i386 Packages 100 /var/lib/dpkg/status ProblemType: Bug DistroRelease: Ubuntu 14.04 Package: gnome-terminal 3.6.2-0ubuntu1 ProcVersionSignature: Ubuntu 3.13.0-34.60-generic 3.13.11.4 Uname: Linux 3.13.0-34-generic i686 ApportVersion: 2.14.1-0ubuntu3.3 Architecture: i386 CurrentDesktop: Unity Date: Fri Aug 22 22:37:38 2014 ExecutablePath: /usr/bin/gnome-terminal InstallationDate: Installed on 2014-04-19 (124 days ago) InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release i386 (20140417) ProcEnviron: LANGUAGE=ru PATH=(custom, no user) XDG_RUNTIME_DIR=<set> LANG=ru_RU.UTF-8 SHELL=/bin/bash SourcePackage: gnome-terminal UpgradeStatus: No upgrade log present (probably fresh install) ** Affects: gnome-terminal (Ubuntu) Importance: Undecided Status: New ** Tags: apport-bug gnome-terminal gterm i386 trusty unicode -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to gnome-terminal in Ubuntu. https://bugs.launchpad.net/bugs/1360419 Title: Buffer containing russian Unicode charecters is not cleaning after pressing Backspace Status in “gnome-terminal” package in Ubuntu: New Bug description: I'm writing C applications for Ubuntu and I've find out interesting bug. That's a short program showing what's wrong. It reads a line from user and writes that line. "#include <stdio.h> void main() { char buffer[1024]; for (;;) { fgets(buffer, sizeof buffer-1, stdin); printf("%s\n", buffer); } }" When I'm using a gnome-terminal with UTF-8 encoding, if I write in this program a string "Hello!", then delete it all with Backspace, than press Enter, I'll see: program have red an empty string, as expected. Then I write "123", delete it, press Enter and see: program have red an empty string, as expected. But if I write a string on russian, for example "Привет!", delete it all and press Enter, i'll see that program had red a string "Пр". If after full deletion of "Привет!" I write a string "123", it will show "При123". And this problem is happening with any Unicode russian string, that need to be edited, even if you want to replace only one symbol: say, I'm enter "Привед", delete one character and press "т" to change it to "Привет" - than program says it red a string "Приве�т". There's no such problems if I enter strings which contain only english letters and/or numbers. There's no such problem if I use any other encoding, which can be selected in gnome-terminal menu: KOI8R, WINDOWS1251, ISO-8859-5. I didn't noticed such problem on both XTerm an UXTerm, probably because they're don't using Unicode; there's also no such problem on LXTerminal, XTerm and UXTerm on my other machine running Lubuntu, probably by the same reason. Thanks you very much in advance for any efforts to solve this issue. System info: > lsb_release -rd Description: Ubuntu 14.04.1 LTS Release: 14.04 > apt-cache policy gnome-terminal gnome-terminal: Установлен (Installed): 3.6.2-0ubuntu1 Кандидат (Candidate): 3.6.2-0ubuntu1 Таблица версий (Table of versions): *** 3.6.2-0ubuntu1 0 500 http://ru.archive.ubuntu.com/ubuntu/ trusty/main i386 Packages 100 /var/lib/dpkg/status ProblemType: Bug DistroRelease: Ubuntu 14.04 Package: gnome-terminal 3.6.2-0ubuntu1 ProcVersionSignature: Ubuntu 3.13.0-34.60-generic 3.13.11.4 Uname: Linux 3.13.0-34-generic i686 ApportVersion: 2.14.1-0ubuntu3.3 Architecture: i386 CurrentDesktop: Unity Date: Fri Aug 22 22:37:38 2014 ExecutablePath: /usr/bin/gnome-terminal InstallationDate: Installed on 2014-04-19 (124 days ago) InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release i386 (20140417) ProcEnviron: LANGUAGE=ru PATH=(custom, no user) XDG_RUNTIME_DIR=<set> LANG=ru_RU.UTF-8 SHELL=/bin/bash SourcePackage: gnome-terminal UpgradeStatus: No upgrade log present (probably fresh install) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gnome-terminal/+bug/1360419/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp