[pve-devel] [PATCH vncterm 3/3] add utf8 parameter to vncterm

Dominik Csapak d.csapak at proxmox.com
Tue Feb 28 12:06:44 CET 2017


this adds a parameter 'utf8' to vncterm to manually enable utf8 mode

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 vncterm.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/vncterm.c b/vncterm.c
index cc61293..636f93c 100644
--- a/vncterm.c
+++ b/vncterm.c
@@ -2286,6 +2286,7 @@ main (int argc, char** argv)
   struct timeval tv, tv1;
   time_t elapsed, cur_time;
   struct winsize dimensions;
+  uint8_t utf8 = 0;
 
   if (gnutls_global_init () < 0) {
 	  fprintf(stderr, "gnutls_global_init failed\n");
@@ -2331,6 +2332,9 @@ main (int argc, char** argv)
           fprintf(stderr, "missing env PVE_VNC_TICKET (-notls)\n");
 	  exit(-1);           
         }
+    } else if (!strcmp (argv[i], "-utf8")) {
+      utf8 = 1;
+      rfbPurgeArguments(&argc, &i, 1, argv); i--;
     }
   }
 
@@ -2351,7 +2355,7 @@ main (int argc, char** argv)
   char *ctype = setlocale (LC_CTYPE, NULL); // query LC_CTYPE
 
   // fixme: ist there a standard way to detect utf8 mode ?
-  if (strcasestr (ctype, ".utf-8")||strcasestr (ctype, ".utf8")) {
+  if (strcasestr (ctype, ".utf-8")||strcasestr (ctype, ".utf8") || utf8) {
     vt->utf8 = 1;
   }
 
-- 
2.1.4





More information about the pve-devel mailing list