I found a wierdness with URI class in my .net framework 4.8 project.
The strange thing is that the same code works differently in my simple console application and in the local copy of the production application. Both are running on the same computer, and on the same framework version.
Here is the code:
var test = new Uri("https://myhost.net/Publications/te%21st%C3%87.pdf");
Console.WriteLine(test.AbsolutePath);
So the filename is te!stÇ.pdf
. And Ç
is Turkish letter.
Everything works great in my local app. The output is /Publications/te%21st%C3%87.pdf
But in my local copy of production app (which is running in IIS) it outputs: /Publications/te!st%C3%87.pdf
.
So it decodes %21
to !
for some reason. But if i replace Turkish Ç
with English C
then %21
is not decoded. Any ideas what is going on?