cli icon indicating copy to clipboard operation
cli copied to clipboard

`gh release upload` option to preserve unicode file names

Open UltimatePea opened this issue 1 year ago • 1 comments

Describe the bug

Uploading e.g. gh release upload <release_name> <file_name>, if <file_name> contains unicode characters, these characters will be truncated.

gh version 2.4.0+dfsg1 (2022-03-23 Ubuntu 2.4.0+dfsg1-2) https://github.com/cli/cli/releases/latest

Steps to reproduce the behavior

  1. I typed gh release upload v0.1.0alpha2.0.1 yy_bs_bs yy_bs_bs_debug ./runtime/libyyrtdeb ug.so ./runtime/libyyrtopt.so ./.yybuild.nosync/yy_入口_豫言编译器默认执行包.bc ./.yybuild.nosync/yy_入口_豫言编译器默 认执行包.opt.bc

  2. The artifacts on the web did not perserve the file names. https://github.com/yuyan-lang/yuyan/releases/tag/v0.1.0alpha2.0.1

Expected vs actual behavior

The command should preserve unicode file names, or offer an option to preserve unicode file names.

UltimatePea avatar Jan 15 '24 14:01 UltimatePea

Hey @UltimatePea sorry for the delay in responding after the Christmas vacation. Some team changes and a large backlog.

Do you know what happens if you add an asset with a unicode file name through the Web UI? It seems like it should work but I just want to confirm because it looks like the CLI was supposed to mimic the platform: https://github.com/cli/cli/blob/24481c5c2e49d3529a6621953b8878fe0514ff22/pkg/cmd/release/upload/upload.go#L131-L153

williammartin avatar Feb 21 '24 13:02 williammartin

Thank you for the triage.

I tested and found that the webui also replaces unicode file names with a dot. I guess we will need to wait for webui to accept the unicode file names first?

UltimatePea avatar Feb 25 '24 21:02 UltimatePea

Yeh, I would suggest opening a discussion over in https://github.com/orgs/community/discussions. Unfortunately, it seems like there might be longstanding reasons for this. Unfortunately, until the API handles this correctly, we don't have any choice.

I'll leave this open and label is as blocked so that others can find it if they experience the same issue.

williammartin avatar Feb 26 '24 13:02 williammartin