File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ WORKDIR /app/
99ADD . .
1010RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-w -s" -o /palog .
1111
12- FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.19
12+ FROM --platform=${TARGETPLATFORM:-linux/amd64} debian:bookworm-slim
1313COPY --from=builder /palog /palog
1414RUN apk add --no-cache icu
1515
Original file line number Diff line number Diff line change @@ -49,13 +49,7 @@ func init() {
4949 }
5050}
5151
52- func escapeString (s string ) string {
53- s = strings .ReplaceAll (s , " " , "_" )
54-
55- if ! uconvLatin {
56- return s
57- }
58-
52+ func runUconvLatin (s string ) string {
5953 var out strings.Builder
6054 cmd := exec .Command ("uconv" , "-x" , "latin" )
6155 cmd .Stdin = strings .NewReader (s )
@@ -68,7 +62,26 @@ func escapeString(s string) string {
6862 return s
6963 }
7064
71- return strings .TrimSpace (out .String ())
65+ return out .String ()
66+ }
67+
68+ func escapeString (s string ) string {
69+ if uconvLatin {
70+ s = runUconvLatin (s )
71+ }
72+ s = strings .ReplaceAll (s , " " , "_" )
73+ s = strings .TrimSpace (s )
74+
75+ runes := []rune (s )
76+ for i := range runes {
77+ b := []byte (string (runes [i ]))
78+
79+ if len (b ) != 1 {
80+ runes [i ] = '*'
81+ }
82+ }
83+
84+ return string (runes )
7285}
7386
7487func main () {
You can’t perform that action at this time.
0 commit comments