Репозитории ALT
S: | 4.8.30-alt3 |
5.1: | 4.8.11-alt0.M51.1 |
4.1: | 4.6.2-alt7.pre1 |
4.0: | 4.6.1r-alt9 |
3.0: | 4.6.1r-alt3 |
Группа :: Работа с файлами
Пакет: mc
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: mc-4.6.2-rh-utf8-8bit-hex.patch
Скачать
Скачать
--- mc-2006-08-12-18/edit/editdraw.c.8bit-hex 2006-09-05 14:35:21.000000000 +0200
+++ mc-2006-08-12-18/edit/editdraw.c 2006-09-05 14:35:21.000000000 +0200
@@ -70,12 +70,22 @@
*/
if (edit->curs1 < edit->last_byte) {
mc_wchar_t cur_byte = edit_get_byte (edit, edit->curs1);
+ mc_wchar_t cur_byte2 = cur_byte;
#ifndef UTF8
g_snprintf (byte_str, sizeof (byte_str), "%c %3d 0x%02X",
is_printable (cur_byte) ? cur_byte : '.',
#else /* UTF8 */
+ /* In 8-bit locales show the byte itself instead of its Unicode value */
+ if (MB_CUR_MAX == 1) {
+ unsigned char cur_8bit_byte;
+ mbstate_t mbs;
+ memset (&mbs, 0, sizeof (mbs));
+ if (wcrtomb(&cur_8bit_byte, cur_byte, &mbs) == 1) {
+ cur_byte = cur_8bit_byte;
+ }
+ }
g_snprintf (byte_str, sizeof(byte_str), "%lc %3d 0x%02X",
- iswprint(cur_byte) ? cur_byte : '.',
+ iswprint(cur_byte2) ? cur_byte2 : '.',
#endif /* UTF8 */
(int) cur_byte,
(unsigned) cur_byte);