aboutsummaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2026-03-15 14:54:44 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2026-03-15 14:54:44 -0700
commitf78ab940a8c09702be3e0ba310ac56e02fa76701 (patch)
tree4b128f55860d1ce7ef9c87861179d97f5732b476 /cmd
parent72c6ddc104c349a4798fddeaa8f77dbe139fe104 (diff)
Add configurable text encoding for file and folder names
Replace hardcoded Mac Roman encoding globals with a configurable Encoding field in config.yaml. Servers that exclusively serve modern UTF-8 clients can now set Encoding: utf8 to disable Mac Roman conversion. The default remains "macintosh" for backward compatibility. - Add Encoding field to Config struct (macintosh|utf8) - Store TextDecoder/TextEncoder on Server, initialized from config - Add TextDecoder()/TextEncoder() accessors on ClientConn - Pass decoder/encoder explicitly to ReadPath and GetFileNameList - Remove package-level txtEncoder/txtDecoder globals - Add warning log when files are skipped due to encoding errors - Log and return error replies in HandleGetFileNameList on failure - Document the new config option in docs/text-encoding.md
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mobius-hotline-server/mobius/config/config.yaml7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/mobius-hotline-server/mobius/config/config.yaml b/cmd/mobius-hotline-server/mobius/config/config.yaml
index 71b7e65..d7ded22 100644
--- a/cmd/mobius-hotline-server/mobius/config/config.yaml
+++ b/cmd/mobius-hotline-server/mobius/config/config.yaml
@@ -25,6 +25,13 @@ Trackers:
- hotline.kicks-ass.net:5499
# - example-tracker-with-password.com:5499:mypassword
+# Text encoding used for file and folder names sent to and from clients.
+# Supported values:
+# "macintosh" - Translates between Mac Roman and UTF-8 (default, compatible with classic Hotline clients)
+# "utf8" - No conversion; passes file names through as-is (for servers with only modern UTF-8 clients)
+# If omitted, defaults to "macintosh".
+Encoding: macintosh
+
# Preserve resource forks and file type/creator codes for files uploaded by Macintosh clients.
# This comes with trade-offs. For more details, see:
# https://github.com/jhalter/mobius/wiki/Resource-fork-support-in-Mobius