Skip to content

[Windows] Path handling does not support UTF-8 properly #49372

@Tokenyet

Description

@Tokenyet

After testing a bunch of C method, I found out there is something strange in the flutter engine source code

  std::string icu_data_path;
  if (SAFE_ACCESS(args, icu_data_path, nullptr) != nullptr) {
    icu_data_path = SAFE_ACCESS(args, icu_data_path, nullptr);
  }
...
  settings.icu_data_path = icu_data_path;
  settings.assets_path = args->assets_path;

According to icu_data_path, why does assets_pathnot need to use SAFE_ACCESS? This is the wired thing I found, becuase icu_data_path seems to work with Chinese, but assets_path not.

I think the code for assets_path should be the same as icu_data_path:

  std::string assets_path ;
  if (SAFE_ACCESS(args, assets_path , nullptr) != nullptr) {
    assets_path = SAFE_ACCESS(args, assets_path , nullptr);
  }
...
  settings.assets_path = assets_path ;

I can't pretty sure this is the error, but after testing every single function with legal Chinese path, this is the only possibility different code. If this is not a legal issue, feel free to close 😢

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: desktopRunning on desktope: embedderUsers of the Embedder APIengineflutter/engine related. See also e: labels.platform-windowsBuilding on or for Windows specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions