aboutsummaryrefslogtreecommitdiffstats
path: root/util/ttyio.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1999-08-31 15:30:12 +0000
committerWerner Koch <[email protected]>1999-08-31 15:30:12 +0000
commit88a916cdd40e43312ffcde6bb1c157fe1c122f74 (patch)
treed5298986a0bad2aff797fd981f99fb3cb6f99ba9 /util/ttyio.c
parentSee ChangeLog: Mon Aug 30 20:38:33 CEST 1999 Werner Koch (diff)
downloadgnupg-88a916cdd40e43312ffcde6bb1c157fe1c122f74.tar.gz
gnupg-88a916cdd40e43312ffcde6bb1c157fe1c122f74.zip
See ChangeLog: Tue Aug 31 17:20:44 CEST 1999 Werner Koch
Diffstat (limited to '')
-rw-r--r--util/ttyio.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/util/ttyio.c b/util/ttyio.c
index 3f5eb7900..74f6ce0f6 100644
--- a/util/ttyio.c
+++ b/util/ttyio.c
@@ -235,6 +235,29 @@ tty_print_string( byte *p, size_t n )
#endif
}
+void
+tty_print_utf8_string( byte *p, size_t n )
+{
+ size_t i;
+ char *buf;
+
+ if (no_terminal)
+ return;
+
+ /* we can handle plain ascii simpler, so check for it first */
+ for(i=0; i < n; i++ ) {
+ if( p[i] & 0x80 )
+ break;
+ }
+ if( i < n ) {
+ buf = utf8_to_native( p, n );
+ tty_printf("%s", buf );
+ m_free( buf );
+ }
+ else
+ tty_print_string( p, n );
+}
+