#11: Use https://github.com/icza/gox stringsx.Clean to remove non-printable characters

This commit is contained in:
Barold 2021-01-24 14:44:25 +02:00
parent f8e1305c08
commit abaf731d7e
3 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"flag" "flag"
"fmt" "fmt"
wkhtml "github.com/SebastiaanKlippert/go-wkhtmltopdf" wkhtml "github.com/SebastiaanKlippert/go-wkhtmltopdf"
"github.com/icza/gox/stringsx"
"github.com/pdfcpu/pdfcpu/pkg/api" "github.com/pdfcpu/pdfcpu/pkg/api"
"github.com/tidwall/gjson" "github.com/tidwall/gjson"
"io/ioutil" "io/ioutil"
@ -418,5 +419,8 @@ func RemoveBadCharacters(input string) string {
for _, badChar := range badCharacters { for _, badChar := range badCharacters {
temp = strings.Replace(temp, badChar, "_", -1) temp = strings.Replace(temp, badChar, "_", -1)
} }
temp = stringsx.Clean(temp)
return temp return temp
} }

Binary file not shown.

Binary file not shown.