[pan2: 5/23] Bug 648375 fix mailto url encoding



commit dddec95aa76982ef79b669ce25447587ed7d2347
Author: K. Haley <haleykd users sf net>
Date:   Mon May 23 22:13:12 2011 -0600

    Bug 648375 fix mailto url encoding
    
    Characters with the high bit set were treated as negative during
    encoding so 0xff became 0xffff.

 pan/gui/post-ui.cc |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/pan/gui/post-ui.cc b/pan/gui/post-ui.cc
index 2b3940f..493458d 100644
--- a/pan/gui/post-ui.cc
+++ b/pan/gui/post-ui.cc
@@ -508,8 +508,9 @@ namespace
       if (keep.count(*pch))
         out += *pch;
       else {
+        unsigned char uc = (unsigned char)*pch;
         char buf[8];
-        g_snprintf (buf, sizeof(buf), "%%%02x", (int)*pch);
+        g_snprintf (buf, sizeof(buf), "%%%02x", (int)uc);
         out += buf;
       }
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]