Closed snowdream closed 2 hours ago
when i open the file with vim, i find the invalid characters:
To ease the integration in your workflow, this action will automatically:
Lowercase the image name
Replace invalid chars sequences with - for tags
To remove invisible or invalid characters from a file in a shell environment, you can use several commands. Here are a couple of effective methods:
tr
CommandThe tr
command can be used to remove non-printable ASCII characters:
tr -cd '\11\12\15\40-\176' < input-file > clean-file
iconv
CommandThe iconv
command can convert text from one encoding to another and can be used to remove invalid characters:
iconv -f utf-8 -t utf-8 -c input-file > clean-file
The -c
option tells iconv
to omit invalid characters from the output¹.
grep
CommandTo find and remove non-UTF-8 characters, you can use grep
:
grep -axv '.*' input-file > clean-file
This command finds lines with invalid UTF-8 characters and removes them¹.
These methods should help you clean up your files by removing any unwanted invisible or invalid characters. If you have a specific scenario or file type in mind, let me know, and I can provide more tailored advice!
源: 与 Copilot 的对话, 2024/9/20 (1) Remove non-printable ASCII characters from a file with this Unix command. https://alvinalexander.com/blog/post/linux-unix/how-remove-non-printable-ascii-characters-file-unix/. (2) How to Remove Non UTF-8 Characters From a File - Baeldung. https://www.baeldung.com/linux/remove-non-utf-8-characters. (3) Remove non-printable ASCII characters from a file with this Unix command. https://bing.com/search?q=shell+command+to+remove+invisible+invalid+characters. (4) undefined. http://www.asciitable.com/. (5) undefined. http://www.csc.villanova.edu/~tway/resources/ascii-table.html.
Contributing guidelines
I've found a bug, and:
Description
image: snowdreamtech/frpc
Expected behaviour
generate right tag: snowdreamtech/frpc:alpine3.20
Actual behaviour
generate wrong tag: snowdreamtech/frpc:alpine3.20-
Repository URL
https://github.com/snowdreamtech/frp
Workflow run URL
https://github.com/snowdreamtech/frp/actions/runs/10937634281/job/30363937723
YAML workflow
long: