aboutsummaryrefslogtreecommitdiff
path: root/hotline/file_path.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2024-04-04 15:37:28 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2024-04-04 15:47:18 -0700
commit2e1aec0fcfd412cff22cc4fc996973e403589ad8 (patch)
tree6be4564a21229eb9c15602ffdc8e2370b7f72242 /hotline/file_path.go
parentdd81e2cf8030aaea778677270d2a1b6ed218d6b8 (diff)
Add support for Mac Roman character encoding.
https://en.wikipedia.org/wiki/Mac_OS_Roman
Diffstat (limited to 'hotline/file_path.go')
-rw-r--r--hotline/file_path.go6
1 files changed, 5 insertions, 1 deletions
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
}