# SE-0243: Codepoint and Character Literals

**URL:** <https://forums.swift.org/t/se-0243-codepoint-and-character-literals/21188>\
**Category:** Proposal Reviews\
**Created:** [March 4, 2019, 3:45pm UTC](https://forums.swift.org/t/se-0243-codepoint-and-character-literals/21188 "2019-03-04T15:45:06Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![johnno1962](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/johnno1962/32/6805_2.png) [@johnno1962](https://forums.swift.org/u/johnno1962)\
**Post date:** [March 4, 2019, 5:16pm UTC](https://forums.swift.org/t/se-0243-codepoint-and-character-literals/21188/7 "2019-03-04T17:16:18Z")

</div>

> [@Nevin](#):
>
> I think `String` should _not_ be expressible by a single-quoted literal, only a double-quoted literal.

This isn’t ideal but difficult to avoid in a ABI stable world:

> [@Prepitch: Character integer literals](https://forums.swift.org/t/prepitch-character-integer-literals/10442/324):
>
> As ExpressibleByStringLiteral inherits from ExpressibleByExtendedGraphemeClusterLiteral which in turn inherits from ExpressibleByUnicodeScalarLiteral there won’t be an ABI stable way to stop `let a: String = ‘a’` from working. I don’t see it as a problem. This is the reason `’a’ + ‘b’ == “ab”` .

> [@Nevin](#):
>
> It is not clear to me why integers are restricted to being represented by ASCII characters only. Every Unicode scalar has a unique integer value, which is already available in Swift at runtime:

Greater flexibility would have been my preference but a long discussion about the subtleties of unicode normalisation persuaded the thread it was best to steer clear of being able to represent integers outside the ASCII range (The Option 2 vs. Option 4 debate). We can always relax this constraint later if a killer use-case turns up.

> [@Nevin](#):
>
> Therefore, perhaps we should make single-quoted characters also be valid _integer_ literals. Instead of trying to shoehorn integer types into accepting `UnicodeScalar` literals, we could simply make the compiler recognize single-quoted characters as another way to spell integer literals.

This was the first implementation proposed (Codepoint literals) but it became obvious the proper abstraction in the Swift string world for single quotes should be as _Character_ literals that can use the more flexible existing protocols for nearly the same result.

---

_[View the full topic](https://forums.swift.org/t/se-0243-codepoint-and-character-literals/21188)._
