In ASP.NET MVC CORE 2.0
public void ConfigureServices(IServiceCollection services)
{
services.Configure<RouteOptions>(options => options.LowercaseUrls = true);
services.AddMvc();
}
<a asp-action="New-Post">New post</a>
Works fine giving URL like http://domain/controller/new-post
But this one
<a asp-action="Новая-Публикация">Новая публикация</a>
produces URL like http://domain/controller/Новая-Публикация
How to fix it to get URLs in low case only for any language?
Seems like
RouteCollection
usesToLowerInvariant()
to lower-case the URL: https://github.com/aspnet/Routing/blob/032bcf43b2cefe641fc6ee9ef3ab0769024a182c/src/Microsoft.AspNetCore.Routing/RouteCollection.cs#L155Quote from MSDN:
And from CultureInfo.InvariantCulture:
So it will not work with other alphabets.
You should check if there is an issue on this in the Routing repo, and post one there. They'll be able to tell if it would be feasible to implement.