From 2e1aec0fcfd412cff22cc4fc996973e403589ad8 Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Thu, 4 Apr 2024 15:37:28 -0700 Subject: Add support for Mac Roman character encoding. https://en.wikipedia.org/wiki/Mac_OS_Roman --- hotline/file_path.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'hotline/file_path.go') diff --git a/hotline/file_path.go b/hotline/file_path.go index 97ce417..620f54d 100644 --- a/hotline/file_path.go +++ b/hotline/file_path.go @@ -5,6 +5,7 @@ import ( "bytes" "encoding/binary" "errors" + "fmt" "io" "path/filepath" "strings" @@ -119,6 +120,9 @@ func readPath(fileRoot string, filePath, fileName []byte) (fullPath string, err subPath, filepath.Join("/", string(fileName)), ) - + fullPath, err = txtDecoder.String(fullPath) + if err != nil { + return "", fmt.Errorf("invalid filepath encoding: %w", err) + } return fullPath, nil } -- cgit