diff options
author | Werner Koch <[email protected]> | 2001-04-20 12:21:23 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2001-04-20 12:21:23 +0000 |
commit | 7c67adea66c9e0cedae4b2045b0a0468fd26f74d (patch) | |
tree | 3818f918abfb115b90e4bfa2dfb4dee34e801afb | |
parent | Fixes for W32 (diff) | |
download | gnupg-7c67adea66c9e0cedae4b2045b0a0468fd26f74d.tar.gz gnupg-7c67adea66c9e0cedae4b2045b0a0468fd26f74d.zip |
Add UTF-8 charset
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | doc/ChangeLog | 4 | ||||
-rw-r--r-- | doc/gpg.sgml | 7 | ||||
-rw-r--r-- | g10/ChangeLog | 6 | ||||
-rw-r--r-- | g10/options.skel | 17 | ||||
-rw-r--r-- | util/ChangeLog | 7 | ||||
-rw-r--r-- | util/strgutil.c | 22 |
8 files changed, 59 insertions, 8 deletions
@@ -38,6 +38,8 @@ was just wrong, so you might notice bad signature in some very big files. It may be wise to keep an old copy of GnuPG around. + * New --charset=utf-8 to bypass all internal translations. + Noteworthy changes in version 1.0.4 (2000-10-17) ------------------------------------------------ @@ -1 +1 @@ -1.0.4h +1.0.4i diff --git a/doc/ChangeLog b/doc/ChangeLog index 32c19c240..59e43d8aa 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2001-04-20 Werner Koch <[email protected]> + + * gpg.sgml: Add new --charset UTF-8. + 2001-04-19 Werner Koch <[email protected]> * faq.raw: Add a note about dates displayed as ????-??-??. diff --git a/doc/gpg.sgml b/doc/gpg.sgml index 0ddaca95c..f343bc07b 100644 --- a/doc/gpg.sgml +++ b/doc/gpg.sgml @@ -367,7 +367,8 @@ assigned owner trust and the second is the calculated trust value. Letters are used for the values:</para> <variablelist> <varlistentry><term>-</term><listitem><para>No ownertrust assigned / not yet calculated.</para></listitem></varlistentry> - <varlistentry><term>e</term><listitem><para>Trust calculation has failed.</para></listitem></varlistentry> + <varlistentry><term>e</term><listitem><para>Trust +calculation has failed; probably due to an expired key.</para></listitem></varlistentry> <varlistentry><term>q</term><listitem><para>Not enough information for calculation.</para></listitem></varlistentry> <varlistentry><term>n</term><listitem><para>Never trust this key.</para></listitem></varlistentry> <varlistentry><term>m</term><listitem><para>Marginally trusted.</para></listitem></varlistentry> @@ -846,6 +847,10 @@ Valid values for &ParmName; are:</para> <varlistentry> <term>koi8-r</term><listitem><para>The usual Russian set (rfc1489).</para></listitem> </varlistentry> +<varlistentry> +<term>utf-8</term><listitem><para>Bypass all translations and assume +that the OS uses native UTF-8 encoding.</para></listitem> +</varlistentry> </variablelist> </listitem></varlistentry> diff --git a/g10/ChangeLog b/g10/ChangeLog index d08090e44..b93e0b3ca 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,6 +1,10 @@ +2001-04-20 Werner Koch <[email protected]> + + * options.skel: Add some more comments. + 2001-04-19 Werner Koch <[email protected]> - * keyid.c (mk_datestr): New. Handles negative times. we must do + * keyid.c (mk_datestr): New. Handles negative times. We must do this because Windoze segvs on negative times passed to gmtime(). Changed all datestr_from function to use this one. diff --git a/g10/options.skel b/g10/options.skel index f2a117e23..ad47c9fa6 100644 --- a/g10/options.skel +++ b/g10/options.skel @@ -31,6 +31,18 @@ $Id$ #default-key 621CC013 +# GnuPG ultimately trusts all keys in the secret keyring. If you do +# not have all your secret keys online available you should use this +# option to tell GnuPG about ultimately trusted keys. +# You have to give the long keyID here which can be obtained by using +# the --list-key command along with the option --with-colons; you will +# get a line similiar to this one: +# pub:u:1024:17:5DE249965B0358A2:1999-03-15:2006-02-04:59:f: +# the 5th field is what you want. + +#trusted-key 12345678ABCDEF01 + + # If you do not pass a recipient to gpg, it will ask for one. # Using this option you can encrypt to a default key. key validation # will not be done in this case. @@ -55,8 +67,8 @@ escape-from-lines # If you do not use the Latin-1 (ISO-8859-1) charset, you should # tell GnuPG which is the native character set. Please check -# the man page for supported character sets. -#charset koi8-r +# the man page for supported character sets. +#charset utf-8 # You may define aliases like this: @@ -92,4 +104,3 @@ lock-once # this option is set. honor-http-proxy - diff --git a/util/ChangeLog b/util/ChangeLog index 1530f07b3..63d932d77 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,10 @@ +2001-04-20 Werner Koch <[email protected]> + + * strgutil.c (set_native_charset): Allow utf-8 by introducing the + new no_translation variable. + (native_to_utf8): Handle no_translation. + (utf8_to_native): Ditto. + 2001-04-19 Werner Koch <[email protected]> * miscutil.c (asctimestamp): Handle negative times. We must do diff --git a/util/strgutil.c b/util/strgutil.c index f65a16167..c1531bbe3 100644 --- a/util/strgutil.c +++ b/util/strgutil.c @@ -67,7 +67,7 @@ static ushort latin2_unicode[128] = { static const char *active_charset_name = "iso-8859-1"; static ushort *active_charset = NULL; - +static int no_translation = 0; void free_strlist( STRLIST sl ) @@ -327,16 +327,24 @@ set_native_charset( const char *newset ) { if( !stricmp( newset, "iso-8859-1" ) ) { active_charset_name = "iso-8859-1"; + no_translation = 0; active_charset = NULL; } else if( !stricmp( newset, "iso-8859-2" ) ) { active_charset_name = "iso-8859-2"; + no_translation = 0; active_charset = latin2_unicode; } else if( !stricmp( newset, "koi8-r" ) ) { active_charset_name = "koi8-r"; + no_translation = 0; active_charset = koi8_unicode; } + else if( !stricmp (newset, "utf8" ) || !stricmp(newset, "utf-8") ) { + active_charset_name = "utf-8"; + no_translation = 1; + active_charset = NULL; + } else return G10ERR_GENERAL; return 0; @@ -360,7 +368,10 @@ native_to_utf8( const char *string ) byte *p; size_t length=0; - if( active_charset ) { + if (no_translation) { + buffer = m_strdup (string); + } + else if( active_charset ) { for(s=string; *s; s++ ) { length++; if( *s & 0x80 ) @@ -424,6 +435,13 @@ utf8_to_native( const char *string, size_t length ) size_t slen; int resync = 0; + if (no_translation) { + buffer = m_alloc (length+1); + memcpy (buffer, string, length); + buffer[length] = 0; /* make sure it is a string */ + return buffer; + } + /* 1. pass (p==NULL): count the extended utf-8 characters */ /* 2. pass (p!=NULL): create string */ for( ;; ) { |