Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non-ascii filenames cause error listing files #131

Open
jtippett opened this issue Jun 8, 2024 · 2 comments
Open

non-ascii filenames cause error listing files #131

jtippett opened this issue Jun 8, 2024 · 2 comments

Comments

@jtippett
Copy link

jtippett commented Jun 8, 2024

Hi there,

I was testing out running a server (MacOS, build from source) and I noticed an issue. Any unicode won't list and produces this log:

2024-06-08T20:28:52.886+0700	debug	Received Transaction	{"remoteAddr": "127.0.0.1:49556", "login": "guest", "name": "guest", "RequestType": "TranGetFileNameList"}
2024-06-08T20:28:52.886+0700	error	Error handling transaction	{"remoteAddr": "127.0.0.1:49556", "login": "guest", "name": "guest", "err": "encoding: rune not supported by encoding."}

my test file names were ベスト.txt and helló.txt. Client was https://github.com/mierau/hotline.

Not sure if this is a bug in the server or client or even an issue in the protocol itself? Either way, thought I'd report it. Thanks for the cool project.

@jtippett jtippett changed the title unicode triggers error listing files non-ascii filenames cause error listing files Jun 8, 2024
@jhalter
Copy link
Owner

jhalter commented Jun 8, 2024

Hi there. Thanks for raising this.

The Mobius project targets compatibility with the original Macintosh Hotline clients, which limits the characters that it can use to those in the Mac OS Roman encoding.

Mobius supports encoding translation for a small subset of unicode characters that have equivalents in the Mac OS Roman character set. For example, or ƒ. Not sure why ó doesn't work -- seems like it should! The Japanese characters would definitely not work though.

I'll fix the file listing transaction to log a better error and skip files with incompatible names instead of totally failing.

@tjohnman
Copy link

Historically, Japanese servers used the Shift JIS encoding. Over the years I've seen servers use Mac OS Roman, Latin 1, Shift JIS and UTF-8. But as far as I know, other than the user selecting what encoding they want to use, or the clients trying to autodetect it, the protocol never took into consideration how to handle it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants