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

Consider using data URI scheme instead of credits_en.html #778

Closed
yukawa opened this issue Jul 25, 2023 · 1 comment
Closed

Consider using data URI scheme instead of credits_en.html #778

yukawa opened this issue Jul 25, 2023 · 1 comment

Comments

@yukawa
Copy link
Collaborator

yukawa commented Jul 25, 2023

Description

Spun off from #777.

Currently about_dialog.cc tries to open credits_en.html from SystemUtil::GetDocumentDirectory() as follows.

const std::string credit_filepath =
FileUtil::JoinPath(SystemUtil::GetDocumentDirectory(), "credits_en.html");
Replace(replaced, "credits_en.html", credit_filepath.c_str());

However it means that each installer (including the one made by Linux distribution package maintainers) needs to correctly install credits_en.html into the target system, which is fragile and hard to maintain as we've seen in #777. Let's see if we can use data URI scheme to embed the data into mozc_tool executable or not.

Steps to reproduce

  1. Open mozc_tool
  2. Click 'open source software'

Expected behavior

See the opensource license information without relying on credits_en.html.

Version or commit-id

b6aa2a3

Environment

  • OS: all desktop
@yukawa
Copy link
Collaborator Author

yukawa commented Oct 14, 2023

It turns out that this is not possible at least in Windows due to the size limit of CreateProcessW.

The maximum length of this string is 32,767 characters, including the Unicode terminating null character.

Unfortunately our credits_en.html is already too big to be passed with CreateProcessW. So closing as "not planned" for now.

For future reference, we could still embed credits_en.html into mozc_tool by showing it with either QTextDocument::setHtml() (or converting it to markdown then showing it with QTextDocument::setMarkdown()).

@yukawa yukawa closed this as not planned Won't fix, can't repro, duplicate, stale Oct 14, 2023
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

No branches or pull requests

1 participant