Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37423506
en ru br
Репозитории ALT
S:8.15.1-alt1
5.1: 1.1.44-alt1.M50P.1
4.1: 1.0.9-alt0.M41.35
4.0: 1.0.9-alt0.M40.35
+backports:1.0.9-alt0.M40.16
3.0: 20050715-alt0.1
+backports:20061212-alt0.M30.1
www.altlinux.org/Changes

Группа :: Эмуляторы
Пакет: wine

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: 0002-libs-wine-Output-unicode-strings-in-UTF-8-encoding.-.patch
Скачать


From 5545da583ed4734192f3bcd2b41b20fcbc9e82e5 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dtimoshkov@etersoft.ru>
Date: Thu, 13 Dec 2012 17:42:25 +0800
Subject: [2/2] libs/wine: Output unicode strings in UTF-8 encoding. (eterbug #8867)
Content-Type: text/plain; charset=UTF-8
---
 libs/wine/debug.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/libs/wine/debug.c b/libs/wine/debug.c
index 36ca5ba511..722ce83bfd 100644
--- a/libs/wine/debug.c
+++ b/libs/wine/debug.c
@@ -40,6 +40,7 @@ WINE_DECLARE_DEBUG_CHANNEL(pid);
 #endif
 
 static const char * const debug_classes[] = { "fixme", "err", "warn", "trace" };
+static const union cptable *ansi_cptable;
 
 #define MAX_DEBUG_OPTIONS 256
 
@@ -233,8 +234,16 @@ static void debug_init(void)
     }
     if ((wine_debug = getenv("WINEDEBUG")))
     {
+        char *lang;
+
         if (!strcmp( wine_debug, "help" )) debug_usage();
         parse_options( wine_debug );
+
+        lang = getenv("LANG");
+        if (!strncasecmp(lang, "ru_RU", 5))
+            ansi_cptable = wine_cp_get_table( 1251 );
+        else
+            ansi_cptable = wine_cp_get_table( 1252 );
     }
 }
 
@@ -309,7 +318,6 @@ static void release_temp_buffer( char *buffer, size_t size )
 /* default implementation of wine_dbgstr_an */
 static const char *default_dbgstr_an( const char *str, int n )
 {
-    static const char hex[16] = "0123456789abcdef";
     char *dst, *res;
     size_t size;
 
@@ -340,10 +348,10 @@ static const char *default_dbgstr_an( const char *str, int n )
                 *dst++ = c;
             else
             {
-                *dst++ = '\\';
-                *dst++ = 'x';
-                *dst++ = hex[(c >> 4) & 0x0f];
-                *dst++ = hex[c & 0x0f];
+                WCHAR wc;
+                /* eterhack: output strings in UTF-8 encoding */
+                wine_cp_mbstowcs(ansi_cptable, 0, (char *)&c, 1, &wc, 1);
+                dst += wine_utf8_wcstombs(0, &wc, 1, dst, 4);
             }
         }
     }
-- 
2.13.3
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin