Episerver 10 UrlSegment have been replaced but how to use UrlCharacterMap?



I've updated my site to Episerver 10 and now I got an error at the line below:

if (!EPiServer.Web.UrlSegment.URLCharacterMap.ContainsKey('Š'))
   EPiServer.Web.UrlSegment.URLCharacterMap.Add('Š', 'S');

I know that the UrlSegment have been replaced with IUrlSegmentCreator/IUrlSegmentLocator/IUrlSegmentGenerator, but how can I replace above code to maken it work?

Hopefully someone can help me.

Kind regards,

Sander van de Pas

Oct 20, 2017 9:28

You should set the character map on UrlSegmentOptions instead, see https://world.episerver.com/documentation/developer-guides/CMS/routing/internationalized-resource-identifiers-iris/

Oct 20, 2017 9:46

Hi Johan,

Thanks for your answer.

I've tried to make it working on the UrlSegmentOptions, but till so far it doesn't work.

Could you have a look at the code below and see anything I'm doing wrong?

public class IRIConfigurationModule : IConfigurableModule
public void ConfigureContainer(ServiceConfigurationContext context)
var options = new UrlSegmentOptions();
options.CharacterMap.Add('Š', 'S');


public void Initialize(InitializationEngine context)
{ }

public void Uninitialize(InitializationEngine context)
{ }

Thanks in advance!

Grtz Sander

Oct 30, 2017 10:21
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.