fix iso-8859-1 to utf8 transcoding bug
authorMichael Schroeder <mls@suse.de>
Fri, 3 May 2013 12:15:37 +0000 (14:15 +0200)
committerMichael Schroeder <mls@suse.de>
Fri, 3 May 2013 12:15:37 +0000 (14:15 +0200)
ext/repo_rpmdb.c
ext/repo_rpmdb_pubkey.c

index dea9305..5ed1c4e 100644 (file)
@@ -439,7 +439,7 @@ setutf8string(Repodata *repodata, Id handle, Id tag, const char *str)
          if (c >= 0xc0)
            {
              *bp++ = 0xc3;
-             c ^= 0x80;
+             c ^= 0xc0 ^ 0x80;
            }
          else if (c >= 0x80)
            *bp++ = 0xc2;
index 8b6b453..2ca79c7 100644 (file)
@@ -102,7 +102,7 @@ setutf8string(Repodata *repodata, Id handle, Id tag, const char *str)
          if (c >= 0xc0)
            {
              *bp++ = 0xc3;
-             c ^= 0x80;
+             c ^= 0xc0 ^ 0x80;
            }
          else if (c >= 0x80)
            *bp++ = 0xc2;