# 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:** 271

<div class="post-metadata">

**Author:** ![jawbroken](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jawbroken](https://forums.swift.org/u/jawbroken)\
**Post date:** [March 17, 2019, 1:10pm UTC](https://forums.swift.org/t/se-0243-codepoint-and-character-literals/21188/271 "2019-03-17T13:10:09Z")

</div>

> [@xwu](#):
>
> Here's how popular programming languages make use of single quotation marks:

I'm not sure if this was being somewhat disingenuous, because I know you're well aware of the particular focus on Unicode-correctness for strings in Swift, but I'll take it at face value. It would be great if you would follow up on the category of “Code unit/code point/Unicode scalar” by specifying what the default “atom” of a string is in these languages, e.g. something like what you get when you index into a string, or what the string's length is calculated in terms of. A quick skim and spot check of a couple of them didn't reveal anything similar to Swift in this respect. Languages which are less interested in Unicode-correct strings are of course going to have a different idea of what this “atom” or “character” is, and that is generally reflected in their “character” syntax, so I don't find this survey very relevant here.

Edit: And of course, this delusion about the obvious default type for single quoted literals isn't unique to me and @RMJay:

> [@Prepitch: Character integer literals](https://forums.swift.org/t/prepitch-character-integer-literals/10442/18):
>
> ```swift
> let x : Int = "f"
> 
> ```
> 
> One nice thing about the C approach with single quotes is that it makes it clear what is going on, and it would allow defining a new default type for:
> 
> ```swift
> let x = 'x'
> 
> ```
> 
> which would clearly be Character.
> 
> -Chris

---

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