コード例 #1
0
  public void xtestRussianSitePath_WithDefaultCharacterEncoding_UTF_8() {

    sitePropertiesService.setProperty(
        siteKey_1, SitePropertyNames.URL_DEFAULT_CHARACTER_ENCODING, "UTF-8");
    httpServletRequest.setRequestURI("/site/1/Services%D0%BB/");

    SitePath sitePath = sitePathResolver.resolveSitePath(httpServletRequest);

    assertEquals(siteKey_1, sitePath.getSiteKey());
    assertEquals("/Servicesл/", sitePath.getLocalPath().toString());
  }
コード例 #2
0
  public void xtestSweedishSitePath_With_ISO_8859_1() {

    sitePropertiesService.setProperty(
        siteKey_1, SitePropertyNames.URL_DEFAULT_CHARACTER_ENCODING, "ISO-8859-1");
    httpServletRequest.setRequestURI("/site/1/B%F6t/");

    SitePath sitePath = sitePathResolver.resolveSitePath(httpServletRequest);

    assertEquals(siteKey_1, sitePath.getSiteKey());
    assertEquals("/Böt/", sitePath.getLocalPath().toString());
  }
コード例 #3
0
  protected void setUp() throws Exception {
    super.setUp();

    urlPathHelper = new UrlPathHelper();
    urlPathHelper.setUrlDecode(true);
    urlPathHelper.setDefaultEncoding("UTF-8");

    sitePropertiesService = new MockSitePropertiesService();
    sitePropertiesService.setProperty(
        siteKey_1, SitePropertyNames.URL_DEFAULT_CHARACTER_ENCODING, "UTF-8");

    urlPathHelperManager = new UrlPathHelperManager();
    urlPathHelperManager.setSitePropertiesService(sitePropertiesService);

    sitePathResolver = new SitePathResolver();
    sitePathResolver.setSitePathPrefix("/site");
    sitePathResolver.setUrlPathHelperManager(urlPathHelperManager);

    httpServletRequest = new MockHttpServletRequest();
    // httpServletRequest.setCharacterEncoding("ISO-8859-1");
  }