GO version of sqlcmd does not parse ANSI text files correctly
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 42/100
Direzione di ricerca
Inizia con il file allegato testfile.txt, che contiene uno spazio unificatore Windows-1252, ed eseguilo con sqlcmd -i testfile.txt. Confronta il risultato di Go sqlcmd con il timestamp previsto e il comportamento di ODBC; il lavoro è completato quando l’input ANSI viene gestito correttamente oppure la limitazione viene documentata come breaking change.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
If a sql text file is encoded as ANSI (as opposed to UTF-8 or similar) the newer Go version of sqlcmd will not correctly parse non-ASCII characters.
For example, if a file contains non-breaking spaces (character 160), which in T-SQL is generally treated identically to a normal space. In ANSI Windows-1252, this is encoded as a single-byte hex A0.
The Go version of sqlcmd appears to assume all files are UTF encoded, for it treats such a character as unknown and replaces it with unicode character 65533, which would be consistent with assuming UTF-8 encoded, for the single byte A0 is not valid UTF-8.
The attached file is a simple example txt file encoded using the Windows notepad as ANSI, containing "SELECT{Non-breaking-space}CURRENT_TIMESTAMP"
It can be run in sqlcmd with a command like:
sqlcmd -i testfile.txt
The original ODBC version of sqlcmd has no problem running the above file, returning the expected timestamp.
The GO version however fails:
"Could not find stored procedure 'SELECT�CURRENT_TIMESTAMP'."
The behavior of the GO sqlcmd should either match the ODBC behavior, or this should be documented as one of the "Breaking changes from sqlcmd (ODBC)" that ANSI-encoded text files are not supported.
- Lingua principale
- Go
- Stelle
- 595
- Fork
- 91
- Merge medio
- 9h 35m
- PR unite (30g)
- 1
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di microsoft/go-sqlcmd
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Fix CVEs in Version v1.10.0 Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 55/100
-
":Help" command not working Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 76/100
Tutte le issue di microsoft/go-sqlcmd
Issue simili
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
agentic-workflows
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
microsoft/agent-framework-go#1179 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
-
[Bug]: OLLAMA_KEEP_ALIVE="5m" / "24h" crashes Ollama embedding and vision models with ValueError Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
infiniflow/ragflow#20223 · 1 reazione ·
-
bug needs triage pkg/translator/faro
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
open-telemetry/opentelemetry-collector-contrib#51484 · 1 commento ·