kemalcr / kemal

Fast, Effective, Simple Web Framework
https://kemalcr.com
MIT License
3.62k stars 188 forks source link

Directory Listing: Add UTF-8 Charset to the response Content type #679

Closed alexkutsan closed 6 months ago

alexkutsan commented 6 months ago

Within the directory listing handler, the absence of an explicit charset in the content type has led to issues, particularly with directories containing non-ASCII symbols, resulting in broken displays.

изображение

Adding charset charset=UTF-8 to the Content-type header fixes this issue.

изображение

Alternate Designs

Benefits

it works

Possible Drawbacks

Not flexible for non UTF-8 cases.

alexkutsan commented 6 months ago

Seams like this part of code is a monkey patched crystal std lib. Added similar PR to original crystal code https://github.com/crystal-lang/crystal/pull/14546