aboutsummaryrefslogtreecommitdiff
path: root/internal/postgres/insert_module.go
diff options
context:
space:
mode:
authorJulie Qiu <julie@golang.org>2020-04-16 21:20:28 -0400
committerJulie Qiu <julieqiu@google.com>2020-04-17 11:59:34 +0000
commitb05b0bb71ea6db24dfb9f779899d3b4951fc93ed (patch)
tree1a088da6422ffbc46afd1dd5196ed9ef40137ea1 /internal/postgres/insert_module.go
parenta67aa7573de80382d74c0eb1e505f56cc39d6b2a (diff)
downloadgo-x-pkgsite-b05b0bb71ea6db24dfb9f779899d3b4951fc93ed.tar.xz
internal/postgres: fix invalid byte seq for readme contents
An error occurred when inserting into readmes: invalid byte sequence for encoding "UTF8" This is now fixed. Change-Id: I51f7d0c22f833b052daabc405495518c4c5e47a4 Reviewed-on: https://team-review.git.corp.google.com/c/golang/discovery/+/720665 CI-Result: Cloud Build <devtools-proctor-result-processor@system.gserviceaccount.com> Reviewed-by: Jonathan Amsterdam <jba@google.com>
Diffstat (limited to 'internal/postgres/insert_module.go')
-rw-r--r--internal/postgres/insert_module.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/postgres/insert_module.go b/internal/postgres/insert_module.go
index a1286390..81fa4d2c 100644
--- a/internal/postgres/insert_module.go
+++ b/internal/postgres/insert_module.go
@@ -402,7 +402,7 @@ func insertDirectories(ctx context.Context, db *database.DB, m *internal.Module,
var readmeValues []interface{}
for path, readme := range pathToReadme {
id := pathToID[path]
- readmeValues = append(readmeValues, id, readme.Filepath, readme.Contents)
+ readmeValues = append(readmeValues, id, readme.Filepath, makeValidUnicode(readme.Contents))
}
readmeCols := []string{
"path_id",