]> Cypherpunks repositories - gostls13.git/commit
go/scanner: report specific error for UCS-2 encoded files
authorAlan Donovan <adonovan@google.com>
Tue, 25 Feb 2025 20:25:56 +0000 (15:25 -0500)
committerGopher Robot <gobot@golang.org>
Wed, 26 Feb 2025 03:23:05 +0000 (19:23 -0800)
commit767c0fb9fd1e7d7210276be45b0abb5d14d34484
tree33191fd9d8d97f460a6834503dadc79612ce06be
parentb38b0c0088039b03117b87eee61583ac4153f2b7
go/scanner: report specific error for UCS-2 encoded files

Windows text files may be encoded as UCS-2 (i.e. 2-byte UTF-16).
This CL causes the scanner to emit a better error when it reads
a file in this encoding.

+ test

Fixes #71950

Change-Id: Ia65bbf9a60e36984b0f3e4865591aa6978d2bde2
Reviewed-on: https://go-review.googlesource.com/c/go/+/652515
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Commit-Queue: Alan Donovan <adonovan@google.com>
src/go/scanner/scanner.go
src/go/scanner/scanner_test.go