Repository navigation
File names on macOS without Unicode with another locale (iconv) - #206
Merged
Merged
Conversation
… locale Without Unicode, strings are the bytes of the locale encoding, and the File and Dir functions gave them as they are to the file system, which accepts only valid UTF-8 names on macOS: with a locale which is neither ASCII nor UTF-8 (e.g. Latin-1, EUC-JP, GB18030), names typed in a terminal using it could not be opened or created. FileName_To_Native() now converts the names which are not valid UTF-8 from the locale encoding to UTF-8, and FileName_From_Native() the names of the file system to the locale encoding when it can encode them and the conversion gives back the same name, as with Unicode; the File and Dir functions use them also without Unicode. The conversions use iconv of the system (wchar_t is not Unicode with most of these locales on macOS), so ZenLib is linked with -liconv on macOS.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
File names on macOS without Unicode, with a locale which is neither ASCII nor UTF-8.
Without Unicode, strings are the bytes of the locale encoding, and the File and Dir functions gave them as they are to the file system, which accepts only valid UTF-8 names on macOS: with e.g. a Latin-1, EUC-JP or GB18030 locale, names typed in a terminal using it could not be opened or created (on Linux and FreeBSD, any bytes are a valid name, so nothing changes there).
To be merged before MediaArea/MediaInfo#1336 and MediaArea/MediaInfoLib#2803, whose tests expect these conversions on macOS without Unicode.