MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / normalizeQuote

Function normalizeQuote

pkg/sql/tokenizer/unicode.go:102–111  ·  view source on GitHub ↗

normalizeQuote converts Unicode quote characters to standard ASCII quotes. This normalization ensures consistent quote handling across different text encodings and input sources (e.g., copy-paste from documents, web forms). Normalization mappings: - U+2018 (') LEFT SINGLE QUOTATION MARK → ' - U+20

(r rune)

Source from the content-addressed store, hash-verified

100// Returns the normalized ASCII quote character, or the original rune if
101// it's not a Unicode quote.
102func normalizeQuote(r rune) rune {
103 switch r {
104 case '\u2018', '\u2019', '\u00AB', '\u00BB': // Single quotes and guillemets
105 return '\''
106 case '\u201C', '\u201D': // Left and right double quotes
107 return '"'
108 default:
109 return r
110 }
111}

Callers 3

readQuotedIdentifierMethod · 0.85
readQuotedStringMethod · 0.85
ReadStringLiteralMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected