[BUG] Filename of assets is not converted to UTF-8 #502

Closed
opened 2026-02-04 20:53:23 +03:00 by OVERLORD · 4 comments
Owner

Originally created by @EnricoBilla on GitHub (Dec 21, 2022).

Describe the bug
The original filename of assets isn't converted to UTF-8 correctly, see below.
Issue has been found both on web frontend and mobile, I guess it's a bug of the server.

Task List

Please complete the task list below. We need this information to help us reproduce the bug or point out problems in your setup. You are not providing enough info may delay our effort to help you.

The bug has been found on the demo, so nothing I had to setup.

  • I have read thoroughly the README setup and installation instructions.
  • I have included my docker-compose file.
  • I have included my redacted .env file.
  • I have included information on my machine, and environment.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the gallery
  2. Open the Génie de la Liberté photo
  3. See the wrongly formatted filename

The actual filename is: Génie_de_la_Liberté_971.jpg
Should be: Génie_de_la_Liberté_971.jpg

Expected behavior
The filename should be converted to UTF-8

Screenshots
Web
Screenshot_20221220_221753

Mobile
photo_2022-12-20_22-27-22

System

  • Phone OS [iOS, Android]: Android 12
  • Server Version: 1.39.0
  • Mobile App Version: 1.39.0
Originally created by @EnricoBilla on GitHub (Dec 21, 2022). **Describe the bug** The original filename of assets isn't converted to UTF-8 correctly, see below. Issue has been found both on web frontend and mobile, I guess it's a bug of the server. **Task List** *Please complete the task list below. We need this information to help us reproduce the bug or point out problems in your setup. You are not providing enough info may delay our effort to help you.* **The bug has been found on the demo, so nothing I had to setup.** - [x] I have read thoroughly the README setup and installation instructions. - [ ] I have included my `docker-compose` file. - [ ] I have included my redacted `.env` file. - [ ] I have included information on my machine, and environment. **To Reproduce** Steps to reproduce the behavior: 1. Go to the gallery 2. Open the Génie de la Liberté photo 3. See the wrongly formatted filename The actual filename is: Génie_de_la_Liberté_971.jpg Should be: Génie_de_la_Liberté_971.jpg **Expected behavior** The filename should be converted to UTF-8 **Screenshots** Web ![Screenshot_20221220_221753](https://user-images.githubusercontent.com/25234601/208769410-ea50f6b7-c566-4923-b178-1df85ba7353e.png) Mobile ![photo_2022-12-20_22-27-22](https://user-images.githubusercontent.com/25234601/208770301-d03eae34-2642-4ba7-9915-e4b8fe911457.jpg) **System** - Phone OS [iOS, Android]: `Android 12` - Server Version: `1.39.0` - Mobile App Version: `1.39.0`
Author
Owner

@jrasm91 commented on GitHub (Dec 21, 2022):

Related to multer -> busboy handling it as latin1.

https://github.com/mscdex/busboy/issues/20

@jrasm91 commented on GitHub (Dec 21, 2022): Related to multer -> busboy handling it as latin1. https://github.com/mscdex/busboy/issues/20
Author
Owner

@EnricoBilla commented on GitHub (Dec 21, 2022):

You beat me on time, I was trying to debug it. So the workaround is to convert it manually afterwards?

Actually duplicate to #951 but I haven't found it before by searching UTF-8 and filename.

@EnricoBilla commented on GitHub (Dec 21, 2022): You beat me on time, I was trying to debug it. So the workaround is to convert it manually afterwards? Actually duplicate to #951 but I haven't found it before by searching `UTF-8` and `filename`.
Author
Owner

@jrasm91 commented on GitHub (Dec 21, 2022):

I think the actual issue is something related to an RFC for file uploads. Adhering to that spec means that busboy assumes it is latin1. Browser doesn't send it as utf8 and I can't figure out how to change that. So it looks like the easy thing to do is convert from latin1 (default assigned encoding) to utf8 (actual encoding) on the server.

@jrasm91 commented on GitHub (Dec 21, 2022): I think the actual issue is something related to an RFC for file uploads. Adhering to that spec means that busboy assumes it is latin1. Browser doesn't send it as utf8 and I can't figure out how to change that. So it looks like the easy thing to do is convert from latin1 (default assigned encoding) to utf8 (actual encoding) on the server.
Author
Owner

@EnricoBilla commented on GitHub (Dec 21, 2022):

Yup got it! Thanks

@EnricoBilla commented on GitHub (Dec 21, 2022): Yup got it! Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#502