Since Unicode contains all ASCII characters you can easily do that:
import unicode
let my_rune = Rune(ord('.'))
echo my_rune
You can partly achieve this for double quoted strings with the raw string call syntax:
import unicode
template u(s: string): seq[Rune] =
toRunes(s)
echo u"abcd"
I don't think you can do the same with single quoted strings, however you can define a very simple macro that turns it into a character literal.
import unicode, macros
macro uc(s: string{lit}): untyped =
result = newCall(bindSym("Rune"), newLit(s.strVal[0]))
echo uc"a"
If you want your character literal to be able to be more than 1 ASCII character you can use compile time evaluation:
import unicode, macros
macro uc(s: string{lit}): untyped =
result = newCall(bindSym("Rune"), newLit(runeAt(s.strVal, 0).int16))
echo uc"漢"
instead of using a macro, you could also use a template, which is imho the better way, since it's a less powerful construct and easier readable:
import unicode
template uc(s: static[string]): Rune =
const runeVal = runeAt(s, 0)
runeVal