Bug 145562

Summary: decodeURIComponent character encoding is broken
Product: [Applications] konqueror Reporter: Thomas Jarosch <thomas.jarosch>
Component: kjsAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Thomas Jarosch 2007-05-17 17:29:59 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    SuSE RPMs

Hello,

while testing Horde's Turba (addressbook) using the German translation I found a bug in kjs's decodeURIComponent function. Consider the following example:

<html>
<body>

<script type="text/javascript">
document.write(decodeURIComponent('Telefon%20gesch%C3%A4ftlich'))
</script>

</body>
</html>

That should display "Telefon geschäftlich" with an umlaut. It works in Firefox,
but konqueror replaces the umlaut with a broken character.

Best regards,
Thomas Jarosch
Comment 1 Peter Palm 2007-10-10 16:51:23 UTC
I can confirm this, ran into the same problem.

The problem is, I can't (won't) fix the code that uses the function, it's in the well known prototype.js library.

Another example:

    <script type="text/javascript">
      <!--
      document.write(decodeURIComponent('Bart%C3%B3k') + "<br>");
      var str = decodeURIComponent('Bart%C3%B3k');
      for (i=0;i<str.length;i++)
        document.write(str.charCodeAt(i) + " ");
        
      // -->
    </script>


Or look at: http://watdoejefout.nl/konqueror/decodeURIComponent.html
Comment 2 Peter Palm 2007-10-10 17:09:01 UTC
By the way, I'm using Konqueror from KDE 3.5.7, Debian Sid
Comment 3 Maksim Orlovich 2007-10-10 18:32:07 UTC
Thanks for the report --- I've fixed this for 3.5.8 independently of this in:
http://lists.kde.org/?l=kde-commits&m=119129888925302&w=2