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) stringParameters & Attributes
| Name | Type | Description |
|---|---|---|
| r | rune | Unicode 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('é'))}