From 1cbc48151632718ee3564792b826fecfcbe8aaa6 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Tue, 4 Oct 2022 07:53:43 +0200 Subject: [PATCH] Allow spaces as legal filename characters --- CHANGELOG.md | 6 ++++++ .../Sources/PassepartoutUtils/Utils/Utils+Strings.swift | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2273be9..454c64b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/PassepartoutLibrary/Sources/PassepartoutUtils/Utils/Utils+Strings.swift b/PassepartoutLibrary/Sources/PassepartoutUtils/Utils/Utils+Strings.swift index fac68c36..ccd801af 100644 --- a/PassepartoutLibrary/Sources/PassepartoutUtils/Utils/Utils+Strings.swift +++ b/PassepartoutLibrary/Sources/PassepartoutUtils/Utils/Utils+Strings.swift @@ -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))