-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Unicode replacement characters cause crash upon closing #570
Comments
I've tried it with some other random files and those lnk files it didn't seem to cause an issue. Maybe it's only with certain filenames? |
Would you mind sharing the file names that you deleted to get your script to pass? |
I would guess that this has nothing to do with lnk files in particular. |
Ok, so I tracked down a single THAT is why only the .lnk files were a problem. Because only those had "��" in them! |
@Knopfi02 two things:
|
additionally, would you be willing to provide a screenshot of the error you are getting? |
This seems related if not the same issue as in #350, however I have unfortunately not been able to reproduce these results so far (Win 10, TS 9.4.1 + 9.5) |
@python357-1 since the issue causes it not not save properly, the ts_library file is empty. All I need to do to cause the crash is have a file with a � in the filename in the library. If I then close it (which means it tries to save the library), the error appears. Manually saving the library (or hitting the "close library" button) instead of closing the entire program, gets it stuck on the "Saving Library..." (or "Closing & Saving Library...") text in the bottom left. At that point closing the program also make the error appear. I have no idea why the lnk turns emojis into �� on my system. I have version 15 of the Noto Color Emoji font installed, but that also doesn't seem to be the cause. |
Would you be able to do a screen recording of you making the shortcut to the file, or a list of steps you're doing to make the link? |
Have a file with emoji in name -> use context menu (or drag n drop while holding alt) to create shortcut -> shortcut file has �� in it's name instead of the emoji Also, apart from the shortcut weirdness, do the unicode replacement characters cause the issue for you aswell? |
Unfortunately I'm not on windows, but cyan is trying the same stuff and tagstudio is not having issues. However, he is able to alt-drag to create a shortcut and the shortcut file has the actual emoji character in the name, not the "��" characters, which is interesting to me. Possibly unrelated, but still interesting |
Here's my tests of this - strangely not running into the same issue... (Windows 10 22H2 19045.5131) |
@Knopfi02 Can you try going to cmd/powershell and typing |
@Knopfi02 nevermind, not that - try going to the directory where you extracted the downloaded TagStudio to and you should find a directory called It may be easier to send the results in a file - you can type |
@CyanVoxel what happens if you just put a � in the filename directly? Since that is the actual thing causing the unicode error. @python357-1 |
I've done that as well, no issues. Both with the red circle and that character. |
@Knopfi02 There should be a lot more than that - try the |
Oh, yeah my bad. Here's the output https://pastebin.com/KJSsQvfv |
Can you try running |
|
I know I've just been asking you to do a lot, so I'll tell you a little bit about what I'm thinking - there is another issue (#350) that seems to be having similar problems. My thought was that you were also using a different locale, because your dates are formatted |
one last try - what is the complete filename of the file that includes |
literally just the red circle, nothing else. |
what type of file is it? |
txt, but same happens for other file types. |
what happens if you name a file "🎞" (U+1F39E) and try to save the library? |
works, no problem |
how did you create the file with the red circle (walk me through the steps)? did you create the U+1F39E file the same way? (if not, walk me through the steps) |
I copy paste the symbol into the filename. that's it. And yes |
What I'm looking for is what the difference is between how the file got saved. Both U+1F534 and U+1F39E, when encoded as utf-16, include a character that is invalid for utf-8 (0xD83D and 0xD83C, respectively). What U+1F39E working and U+1F534 not tells me is somehow, the files got saved differently such that the ones that are causing you trouble were encoded as UTF-16 and the new movie one got saved as UTF-8. What application did you originally save the red circle file with? What about the film one? There is sometimes an option in the "Save as..." dialog to save a file as UTF-16. May you have done that at some point? |
@Knopfi02 If you're interested in and comfortable with compiling TagStudio from source, there's a couple things I could have you try. One would be to try building from |
The red circle DOES work. All emojis that I've tried have worked. It's just that as soon as I make a shortcut in windows, the emojis appear as Unicode replacement characters in the shortcuts filename. @CyanVoxel I'd be happy to tried that, but I'll go to sleep now since it's 5am in my Timezone :P |
Wait, so does Windows itself create the odd characters when creating the .lnk filename? It's not just an issue of TagStudio misreading the filename?
Thank you! And have a good night! |
Yeah! The only problem with tag studio is the that it has issues with files that have Unicode Replacement Characters in their name. |
Checklist
TagStudio Version
Alpha 9.4.1
Operating System & Version
Windows 10, 22H2 Build:19045.5011
Description
I had some shortcuts in the database that linked to some other files in the database and even though TagStudio was able to show the files in the database, upon closing, it crashed and showed an
UnicodeEncodeError: 'utf-8' codec can't encode character
andsurrogates not allowed
error message. This also prevented Tagstudio from saving the database entirely and the saved file was empty.I made a small python script that tried decoding every file and encoding it with UTF-8 and found out that the .lnk shortcut files were causing the issue. After deleting them my script didn't show any errors and Tagstudio didn't crash anymore. (And was also able to actually save the database)
Expected Behavior
Not crash / sucessfully save the database
Steps to Reproduce
or
Logs
No response
The text was updated successfully, but these errors were encountered: