Coder Social home page Coder Social logo

[native_assets] Spaces in paths about sdk HOT 2 CLOSED

dcharkes avatar dcharkes commented on June 28, 2024 1
[native_assets] Spaces in paths

from sdk.

Comments (2)

dcharkes avatar dcharkes commented on June 28, 2024 1

If there is a %20 then it's most likely because the path text was parsed as a URI, and not unparsed back to a system path. The path using forward slashes together with a Windows drive name suggests the same thing.

Correct.

Use File.fromUri(uri).path rather than uri.path. The latter can contain escaped characters, the former should be a valid file path, which may need to be quoted since it can contain spaces. (If the path contained a %, or any URI delimiter character, that would probably be escaped too.)

The error was in the C++ code, but the same logic applies. 👍

Fix: https://dart-review.googlesource.com/c/sdk/+/372421

from sdk.

lrhn avatar lrhn commented on June 28, 2024

If there is a %20 then it's most likely because the path text was parsed as a URI, and not unparsed back to a system path.
The path using forward slashes together with a Windows drive name suggests the same thing.

Use File.fromUri(uri).path rather than uri.path. The latter can contain escaped characters, the former should be a valid file path, which may need to be quoted since it can contain spaces.
(If the path contained a %, or any URI delimiter character, that would probably be escaped too.)

from sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.