Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Sanitizes file and directory names to ensure compatibility with Windows (NTFS &

[![.NET build and test](https://github.com/Codeuctivity/SanitizeFilename/actions/workflows/dotnet.yml/badge.svg)](https://github.com/Codeuctivity/SanitizeFilename/actions/workflows/dotnet.yml) [![NuGet](https://img.shields.io/nuget/v/Codeuctivity.SanitizeFilename.svg)](https://www.nuget.org/packages/Codeuctivity.SanitizeFilename/) [![Donate](https://img.shields.io/static/v1?label=Paypal&message=Donate&color=informational)](https://www.paypal.com/donate?hosted_button_id=7M7UFMMRTS7UE)

Implements rules documented by [Microsoft](https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions) + file name length truncation to 255 bytes, which is common on [many modern](https://en.wikipedia.org/wiki/Comparison_of_file_systems) file systems. Runs on any .NET platform.
Implements rules documented by [Microsoft](https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions) + file name length truncation to 255 bytes, which is common on [many modern](https://en.wikipedia.org/wiki/Comparison_of_file_systems) file systems + some unicode edge cases. Runs on any .NET platform.

## Example

Expand Down Expand Up @@ -37,7 +37,7 @@ Restrictions of Windows, Linux and macOS are all combined to an replacement patt
| Max length | Linux, Windows, macOS | | 255 chars |
| Unpaired Unicode surrogates | macOS, Linux | Windows | U+D800 - U+DFFF |
| NotAssigned to Unicode | macOS | Linux, Windows | U+67803, ... |
| "New" Unicode (today 17+) | macOS | Linux, Windows | 🫩 (U+1FAE9), ... |
| "New" Unicode (today 17+) | macOS | Linux, Windows | [🫈](https://emojipedia.org/hairy-creature), ... |

## .NET framework support

Expand All @@ -60,4 +60,4 @@ $vhdsize = 100MB
New-VHD -Path $vhdpath -Dynamic -SizeBytes $vhdsize | Mount-VHD -Passthru |Initialize-Disk -Passthru |New-Partition -AssignDriveLetter -UseMaximumSize |Format-Volume -FileSystem 'exFAT' -Confirm:$false -NewFileSystemLabel '{exfatLabel}' -Force|Out-Null
```

Running as admin will automatically create and mount a exFat drive while tests are running.
Running as admin will automatically create and mount a exFat drive while tests are running.