Changeset 13463 for trunk


Ignore:
Timestamp:
2006-12-08T12:09:35+13:00 (17 years ago)
Author:
kjdon
Message:

decode_cgi_arg returns utf-8 if the original encoding was utf-8. need to use to_uni on the output in this case. If the encoding isn't utf-8, then 8 bit encodings may be fine but others will be screwed up. Need to fix this properly...

Location:
trunk/gsdl/src/recpt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/queryaction.cpp

    r13366 r13463  
    16491649    // as browsers encode values from forms before sending to server
    16501650    // (e.g. %25 becomes %2525)
    1651     decode_cgi_arg (compressedoptions);
     1651    decode_cgi_arg (compressedoptions);
     1652    if (args["w"] == "utf-8") { // if the encoding was utf-8, then compressed options was utf-8, and we need unicode.
     1653    // if encoding wasn't utf-8, then compressed opotions may be screwed up, but seems to work for 8 bit encodings?
     1654      compressedoptions = to_uni(compressedoptions);
     1655    }
     1656
    16521657    disp.setmacro ("decodedcompressedoptions", displayclass::defaultpackage, dm_safe(compressedoptions));
    16531658      }
  • trunk/gsdl/src/recpt/receptionist.cpp

    r13133 r13463  
    14141414  // as browsers encode values from forms before sending to server
    14151415  // (e.g. %25 becomes %2525)
    1416   decode_cgi_arg (compressedoptions);
    1417   disp.setmacro ("decodedcompressedoptions", displayclass::defaultpackage, dm_safe(compressedoptions));
     1416  decode_cgi_arg (compressedoptions);
     1417  if (args["w"] == "utf-8") { // if the encoding was utf-8, then compressed options was utf-8, and we need unicode.
     1418    // if encoding wasn't utf-8, then compressed opotions may be screwed up, but seems to work for 8 bit encodings?
     1419    compressedoptions = to_uni(compressedoptions);
     1420  }
     1421  disp.setmacro ("decodedcompressedoptions", displayclass::defaultpackage, dm_safe(compressedoptions));
    14181422
    14191423#if defined (__WIN32__)
Note: See TracChangeset for help on using the changeset viewer.