# Non-legal UTF-8 filenames (in e.g. TOML or JSON)

**URL:** <https://discourse.julialang.org/t/non-legal-utf-8-filenames-in-e-g-toml-or-json/126214>\
**Category:** Internals & Design\
**Created:** [February 23, 2025, 5:33pm UTC](https://discourse.julialang.org/t/non-legal-utf-8-filenames-in-e-g-toml-or-json/126214 "2025-02-23T17:33:27Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [February 23, 2025, 9:50pm UTC](https://discourse.julialang.org/t/non-legal-utf-8-filenames-in-e-g-toml-or-json/126214/10 "2025-02-23T21:50:28Z")

</div>

If you construct a filename, with a (future) type for it, then it might be valid to reject non-legal UTF-8 strings (and even QSN-encoding such, by default). But if you e.g. read files from your directly, we must support all files there, including non-UTF-8 (at least I feel like, by default, as I explained with my backup example).

I marked my comment with a solution, for QSN (seems least bad, no solution seems prefect), that I propose Julia would adopt, when you cast to a String.

It can be input into this proposal:

> [@Designing a Paths Julep](https://discourse.julialang.org/t/designing-a-paths-julep/124335):
>
> Prompted by [a gripe I made on Slack](https://julialang.slack.com/archives/C67TK21LJ/p1732097833044289), thoughts I’ve had on paths have coalesed into the start of a Julep and a prototpye. At this stage, I’d love to get wider input on the idea and help shoring it up into a solid proposal for Julia (a Julep). That HackMD document is commentable and editable to anyone logged in, and there’s a basic (and likely lightly buggy) prototype that can be played with. It would be great to have a little working group of sorts to take this to a finished proposal. @jakobn…

---

_[View the full topic](https://discourse.julialang.org/t/non-legal-utf-8-filenames-in-e-g-toml-or-json/126214)._
