filenames_windows.go 494 B

12345678910111213141516171819202122
  1. // Copyright (C) 2014 The Syncthing Authors.
  2. //
  3. // This Source Code Form is subject to the terms of the Mozilla Public
  4. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  5. // You can obtain one at https://mozilla.org/MPL/2.0/.
  6. package osutil
  7. import (
  8. "path/filepath"
  9. "golang.org/x/text/unicode/norm"
  10. )
  11. func NormalizedFilename(s string) string {
  12. return norm.NFC.String(filepath.ToSlash(s))
  13. }
  14. func NativeFilename(s string) string {
  15. return filepath.FromSlash(s)
  16. }