Print better error if identity file is not valid UTF-8? #663
tfg13
started this conversation in
UX reports
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey, I just banged my head against this for a bit, I was wondering if a better error message might be helpful :)
Basically this happens with the default (modern) Windows terminal:
It seems the
>redirect in Windows terminal creates the text file withUTF-16 LEencoding. The error comes from here:age/cmd/age/parse.go
Line 205 in 15153e6
Opening the file in notepad and saving it again as UTF8 fixes this and makes everything work. I only figured it out because
rageproduces a more specific error:Error: stream did not contain valid UTF-8I was wondering if it is worth doing something sililar in
age? Actually handling other encodings seems very annoying, but maybe something like https://pkg.go.dev/unicode/utf8#Valid can be run somewhere here:age/cmd/age/parse.go
Line 213 in 15153e6
Beta Was this translation helpful? Give feedback.
All reactions