The file name is displayed correctly in the file-sending window and initially in the chat, but the modified name can already be seen in the preview of the sent message and is also used as the suggested name when saving the file.
The length of the file name affects the issue. The example above is the shortest tested name for which the bug occurs. Removing one character (65 → 64 characters) makes the problem disappear:
Create and save a file on the computer with the name 2021-04-10_text_file_test_file_test_file_test_file_test_buggy.txt.
Send the file to Saved Messages.
Check the file-sending window.
Check the file name displayed in the chat.
Check the preview of the sent message.
Save the file and check the suggested file name.
Current result
The dash in the long file name is replaced with an underscore after the file is sent. The changed name is visible in the message preview and is also used as the suggested file name when saving the file.
The issue occurs with the 65-character example above but disappears when the name is shortened by one character to 64 characters.
Expected result
The original file name should remain unchanged throughout the process:
The original file on the computer.
The file name displayed in Telegram.
The file name suggested when saving the file from Telegram.
idk about for filenames but the bug I opened about URLs pasted into telegram was merged into this one. If you paste a URL with multiple underscores it may become mangled and therefore result in a 404. there's no way that can be the expected behavior.
1. In no way is this behavior "as expected". 1a. There might be limits on the length of the files, but this means that the files over certain length are not accepted not that the file names over certain length are subjected to adfferent character substitution rule, especially only applying to the "extra" characters. 1b. If substitution rules are in play, they should apply to the whole name, not only partly. So this excuse doesn't fly either. 1c. On the server you can have whatever internal representation of data. But this should not influece the actua names of the files. This is a clear bug. 2. Snce you made a mistake, you should reopen this bug, not to ask users to recreate the bug card.
Why Telegram rename files from bot?
1a. There might be limits on the length of the files, but this means that the files over certain length are not accepted not that the file names over certain length are subjected to adfferent character substitution rule, especially only applying to the "extra" characters.
1b. If substitution rules are in play, they should apply to the whole name, not only partly. So this excuse doesn't fly either.
1c. On the server you can have whatever internal representation of data. But this should not influece the actua names of the files. This is a clear bug.
2. Snce you made a mistake, you should reopen this bug, not to ask users to recreate the bug card.