# Using macros to convert constant single character string to ASCII UInt8 at compile time?

**URL:** <https://forums.swift.org/t/using-macros-to-convert-constant-single-character-string-to-ascii-uint8-at-compile-time/65680>\
**Category:** Using Swift\
**Tags:** macros\
**Created:** [June 19, 2023, 11:52pm UTC](https://forums.swift.org/t/using-macros-to-convert-constant-single-character-string-to-ascii-uint8-at-compile-time/65680 "2023-06-19T23:52:45Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![Max\_Desiatov](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/max_desiatov/32/20654_2.png) [@Max\_Desiatov](https://forums.swift.org/u/Max_Desiatov)\
**Post date:** [June 20, 2023, 3:35pm UTC](https://forums.swift.org/t/using-macros-to-convert-constant-single-character-string-to-ascii-uint8-at-compile-time/65680/15 "2023-06-20T15:35:37Z")

</div>

I've shared a basic implementation of a `#utf8` macro [in the pitch thread](https://forums.swift.org/t/se-0382-expression-macros/62090/23). It would be quite helpful in embedded environments where `String` with Unicode tables is prohibitively expensive.

---

_[View the full topic](https://forums.swift.org/t/using-macros-to-convert-constant-single-character-string-to-ascii-uint8-at-compile-time/65680)._
