Skip to content

exception on binding WPF BitmapImage and german umlauts are used in file names (dotnet 9.0.0 / windows 11) #111355

Open
@wd72

Description

Description

when using filenames on an UNC network share with german umlauts (ü,ö,ä) an Exception is thrown.

Reproduction Steps

use 2 files on unc network path:

\\ps-nas\Temp\products\TestU\testImage.jpg
\\ps-nas\Temp\products\TestÜ\testImage.jpg

WPF Code: (Windows Platform)

<Image Stretch="Uniform" StretchDirection="DownOnly" HorizontalAlignment="Center" Width="300" Height="300">
    <Image.Source >
       <BitmapImage UriSource="{Binding FullFileName2}" CacheOption="OnLoad" />
    </Image.Source>
</Image>

ViewModel/Model Code:

    public string FullFileName2 { get { return @"\\ps-nas\Temp\products\TestU\testImage.jpg"; } }   // --> this works
    public string FullFileName2 { get { return @"\\ps-nas\Temp\products\TestÜ\testImage.jpg"; } }   // --> this does not work 

Expected behavior

german umlauts in filenames should work like in dotnet 8.

Actual behavior

Inner Exception 1:
DirectoryNotFoundException: Could not find a part of the path '\\ps-nas\temp\products\testü\testimage.jpg\Temp\products\TestÜ\testImage.jpg'.

the Image class does not use the provided path an appends something weird. --> the modified file name does not exist --> Exception.

wrong filename:
\\ps-nas\temp\products\testü\testimage.jpg\Temp\products\TestÜ\testImage.jpg
should be:
\\ps-nas\temp\products\testü\testimage.jpg

Regression?

this bug does not occur in dotnet 8

Known Workarounds

No response

Configuration

dotnet 9.0.0, Windows 11 24H2,

   <TargetFramework>net9.0-windows</TargetFramework>
   <Nullable>enable</Nullable>
   <UseWPF>true</UseWPF>
   <UseWindowsForms>true</UseWindowsForms>
   <PlatformTarget>x64</PlatformTarget>

Other information

No response

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions