Wicket
  1. Wicket
  2. WICKET-1413

RequestUtils.toAbsolutePath() has a bug regarding to UTF-8 encoded page parameter.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.3.0-final
    • Fix Version/s: 1.3.5
    • Component/s: wicket
    • Labels:
      None
    • Environment:
      Wicket 1.3.0 (maybe 1.3.1 too)

      Description

      It seems RequestUtils.toAbsolutePath() has a bug regarding to UTF-8 encoded page parameter :

      I have a bookmarkable page , which takes a UTF-8 encoded parameter "place" :

      private PageParameters pps;
      pps.put("place", URLEncoder.encode(place , "UTF-8"));

      In this Page , I have a TextField that prints the URL for this page (for users to copy) :
      String url = RequestUtils.toAbsolutePath("");
      TextField resultUrl;
      resultUrl = new TextField("resultUrl");
      resultUrl.setModel(new Model( url ));
      resultUrl.setEscapeModelStrings(false);
      resultUrl.setOutputMarkupId(true);
      add(resultUrl);

      For example , "台北市" (Chinese word : "Taipei" ) is encoded correctly to :
      place/%25E5%258F%25B0%25E5%258C%2597%25E5%25B8%2582
      And it is correctly shown in the browser URL bar.

      But it is incorrectly shown in the textfield :
      place/%E5%8F%B0%E5%8C%97%E5%B8%82

        Activity

          People

          • Assignee:
            Johan Compagner
            Reporter:
            smallufo
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development