From f78ab940a8c09702be3e0ba310ac56e02fa76701 Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Sun, 15 Mar 2026 14:54:44 -0700 Subject: 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 --- cmd/mobius-hotline-server/mobius/config/config.yaml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cmd') 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 -- cgit