Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error processing migration files encoded as UTF-8 with BOM #1136

Open
lospejos opened this issue Aug 22, 2024 · 0 comments
Open

Error processing migration files encoded as UTF-8 with BOM #1136

lospejos opened this issue Aug 22, 2024 · 0 comments

Comments

@lospejos
Copy link

lospejos commented Aug 22, 2024

Describe the Bug
There is an error:
error: migration failed: syntax error at or near "" (column 1) in line 1
when processing migration files encoded as UTF-8 with BOM

Steps to Reproduce
Steps to reproduce the behavior:

  1. My migration file has no SQL errors, and is encoded using UTF-8 with BOM;
  2. I ran migrate to use this migration file;
  3. See error: error: migration failed: syntax error at or near "" (column 1) in line 1

Expected Behavior
Migration processed without errors.

Migrate Version
4.17.1

Loaded Source Drivers
Source drivers: godoc-vfs, s3, go-bindata, file, github, github-ee, gitlab, bitbucket, gcs

Loaded Database Drivers
Database drivers: cassandra, postgresql, spanner, pgx, postgres, redshift, neo4j, clickhouse, pgx5, cockroach, cockroachdb, sqlserver, yugabyte, yugabytedb, stub, firebird, firebirdsql, crdb-postgres, mongodb, mongodb+srv, mysql, pgx4, ysql, rqlite

Go Version
go version go1.23.0 windows/amd64

Stacktrace
Nlo stack strace, just migration file printed to stdout.

Additional context
I suppose this may be not a migrate bug, rather than golang bug dealing with files encoded as UTF8 with BOM.

See also:

https://stackoverflow.com/a/21375405/1828296

https://pkg.go.dev/golang.org/x/text/encoding/unicode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant