aboutsummaryrefslogtreecommitdiffstats
path: root/unix/vncviewer
diff options
context:
space:
mode:
authorPeter Åstrand <astrand@cendio.se>2009-01-26 13:35:31 +0000
committerPeter Åstrand <astrand@cendio.se>2009-01-26 13:35:31 +0000
commit3336ac4605d9f78bfc48f37763a010530f11a6ba (patch)
tree8d3bddf073e2e7c8907ae3510e576c42bc2d4458 /unix/vncviewer
parentaa409f161eca629892323b834d458610f5f6c494 (diff)
downloadtigervnc-3336ac4605d9f78bfc48f37763a010530f11a6ba.tar.gz
tigervnc-3336ac4605d9f78bfc48f37763a010530f11a6ba.zip
Make sure both console and GUI about text is displayed correctly, even in UTF-8 environments.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3578 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/vncviewer')
-rw-r--r--unix/vncviewer/vncviewer.cxx25
1 files changed, 16 insertions, 9 deletions
diff --git a/unix/vncviewer/vncviewer.cxx b/unix/vncviewer/vncviewer.cxx
index 007c425a..f39d8b8e 100644
--- a/unix/vncviewer/vncviewer.cxx
+++ b/unix/vncviewer/vncviewer.cxx
@@ -267,20 +267,27 @@ int main(int argc, char** argv)
bindtextdomain(PACKAGE_NAME, LOCALEDIR);
textdomain(PACKAGE_NAME);
- snprintf(aboutText, sizeof(aboutText),
- _("TightVNC Viewer for X version %s - built %s\n"
- "Copyright (C) 2002-2005 RealVNC Ltd.\n"
- "Copyright (C) 2000-2006 TightVNC Group\n"
- "Copyright (C) 2004-2005 Peter Astrand, Cendio AB\n"
- "See http://www.tightvnc.com for information on TightVNC."),
- PACKAGE_VERSION, buildtime);
+ const char englishAbout[] = N_("TightVNC Viewer for X version %s - built %s\n"
+ "Copyright (C) 2002-2005 RealVNC Ltd.\n"
+ "Copyright (C) 2000-2006 TightVNC Group\n"
+ "Copyright (C) 2004-2005 Peter Astrand, Cendio AB\n"
+ "See http://www.tightvnc.com for information on TightVNC.");
+
+ // Write about text to console, still using normal locale codeset
+ snprintf(aboutText, sizeof(aboutText),
+ gettext(englishAbout), PACKAGE_VERSION, buildtime);
fprintf(stderr,"\n%s\n", aboutText);
+ // Set gettext codeset to what our GUI toolkit uses. Since we are
+ // passing strings from strerror/gai_strerror to the GUI, these must
+ // be in GUI codeset as well.
bind_textdomain_codeset(PACKAGE_NAME, "iso-8859-1");
- // Since we are passing strings from strerror/gai_strerror to the
- // GUI, these must be in GUI codeset as well.
bind_textdomain_codeset("libc", "iso-8859-1");
+ // Re-create the aboutText for the GUI, now using GUI codeset
+ snprintf(aboutText, sizeof(aboutText),
+ gettext(englishAbout), PACKAGE_VERSION, buildtime);
+
rfb::initStdIOLoggers();
rfb::LogWriter::setLogParams("*:stderr:30");