Skip to content
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

The build process will change the encoding of the license.rtf file. #8512

Closed
TianbinTobin opened this issue Sep 20, 2024 · 6 comments · Fixed by #8551
Closed

The build process will change the encoding of the license.rtf file. #8512

TianbinTobin opened this issue Sep 20, 2024 · 6 comments · Fixed by #8551

Comments

@TianbinTobin
Copy link

  • Electron-Builder Version: v25.1.4
  • Node Version: v20.16.0
  • Electron Version: v31.6.0
  • Electron Type (current, beta, nightly): current
  • Target: windows

The original encoding of my license.rtf file is UTF-8, but after the build process, the encoding has changed to UTF-8 with BOM.
This behavior will cause the License display on the installation interface to appear as garbled text.
(My language is Chinese.)
image

@mmaietta
Copy link
Collaborator

@TianbinTobin what OS are you packaging your Windows app on?

@beyondkmp looks like this may be related to the changes in #8314. Wondering if we need to have conditional logic when building on windows vs mac w.r.t file encoding

@TianbinTobin
Copy link
Author

TianbinTobin commented Sep 20, 2024

what OS are you packaging your Windows app on?

@mmaietta Windows 11

@beyondkmp
Copy link
Collaborator

@mmaietta In #8294, I have only fixed the issue of garbled text display on Windows.

The problem describing seems to be a different issue on Windows. @TianbinTobin Could you provide a minimal demo to reproduce the problem?

@TianbinTobin
Copy link
Author

Could you provide a minimal demo to reproduce the problem?

https://github.com/TianbinTobin/electron-builder-8512.git

The first build will change the encoding of the rtf file, and the second build of the installation package will appear garbled on windows. @beyondkmp

@beyondkmp
Copy link
Collaborator

beyondkmp commented Oct 1, 2024

@TianbinTobin I have a question: Why not write Chinese directly in this file? If Chinese is written directly, there wouldn't be any issues even with multiple compilations.
image

@beyondkmp
Copy link
Collaborator

Root Cause: If the file is already in UTF-8 BOM format, there's no need to convert it again. If it's converted again, it will result in garbled characters.

xyloflake pushed a commit to xyloflake/electron-builder that referenced this issue Oct 2, 2024
…land#8551)

fix electron-userland#8512

If the file is already in UTF-8 BOM format, there's no need to convert
it again. If it's converted again, it will result in garbled characters.

---------

Co-authored-by: beyondkmp <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants