Allow spaces as legal filename characters

This commit is contained in:
Davide De Rosa 2022-10-04 07:53:43 +02:00
parent fab982bf81
commit 1cbc481516
2 changed files with 7 additions and 1 deletions

View File

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Changed
- Retain whitespaces in imported file names.
## 2.0.0 (2022-10-02)
### Added

View File

@ -73,7 +73,7 @@ extension CharacterSet {
public static let filename: CharacterSet = {
var chars: CharacterSet = .decimalDigits
let english = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
let symbols = "-_."
let symbols = " -_."
chars.formUnion(CharacterSet(charactersIn: english))
chars.formUnion(CharacterSet(charactersIn: english.lowercased()))
chars.formUnion(CharacterSet(charactersIn: symbols))