solidjs / solid-router

A universal router for Solid inspired by Ember and React Router
MIT License
1.13k stars 143 forks source link

File names with non-ASCII characters cannot be routed correctly #330

Closed WincerChan closed 7 months ago

WincerChan commented 1 year ago

I have noticed that the file-based routing system in solid-start returns a 404 error if the file name contains non-ASCII characters. This is because non-ASCII characters are encoded once in the URI, causing a mismatch with the original file name.

I have found a solution by modifying the toPath function in the start/fs-router/path-utils.js file to encode the return value as well.

Can you please confirm if this change is necessary and provide guidance on its potential impact? If necessary, I am willing to submit a pull request to implement this modification.

example repo: https://github.com/WincerChan/solid-non-ascii-routing

图片 图片
ryansolid commented 7 months ago

This should be fixed in the latest.