# Pre-RFC: String from ASCII (not allowing UTF-8)

**URL:** <https://internals.rust-lang.org/t/pre-rfc-string-from-ascii-not-allowing-utf-8/14617>\
**Category:** libs\
**Created:** [May 3, 2021, 2:50am UTC](https://internals.rust-lang.org/t/pre-rfc-string-from-ascii-not-allowing-utf-8/14617 "2021-05-03T02:50:11Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![scottmcm](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/scottmcm/32/2355_2.png) [@scottmcm](https://internals.rust-lang.org/u/scottmcm)\
**Post date:** [May 3, 2021, 2:57am UTC](https://internals.rust-lang.org/t/pre-rfc-string-from-ascii-not-allowing-utf-8/14617/2 "2021-05-03T02:57:17Z")

</div>

My instinct here is that if it's important that it's just ASCII, then it might as well use an [`AsciiStr`](https://docs.rs/ascii/1.0.0/ascii/struct.AsciiStr.html) so you can know that on the consumption side. And if it's not important on the consumption side, this feels like a very small improvement -- UTF-8 validation tends to already have a fast path for ASCII, so it's not clear to me that this would even be materially faster in the normal case.

---

_[View the full topic](https://internals.rust-lang.org/t/pre-rfc-string-from-ascii-not-allowing-utf-8/14617)._
