Standard library / strconv

strconv.QuoteRuneToASCII()

Returns a single-quoted Go rune literal with non-ASCII characters escaped. Expected stdout: "'\\u00e9'\n".

Formal Syntax & Structure

go syntaxgo
func QuoteRuneToASCII(r rune) string

Parameters & Attributes

NameTypeDescription
rruneUnicode code point to inspect or quote.

Return Value

string

Encoded representation.

Working Example

Example Snippetgo
package main
import (  "fmt"  "strconv")
func main() {  fmt.Println(strconv.QuoteRuneToASCII('é'))}
Go Reference