CesiumGS / CesiumGS/cesium-unity

`file:///` URLs with escaped spaces (`%20`) do not work

Open
#522 14 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
535
Forks
132
Avg merge
6h 45m
Merged PRs (30d)
1

Description

The `CesiumUtility::Uri::resolve()` function does not seem to handle a base URI with spaces as expected, **even when the spaces are encoded as `%20`**.
Specifically, I'm working with a file URI, so let's use `file:///C:/Temp/3d%20tiles/tileset.json` as an example.

Note: I am not sure the problem is within this specific function, this is just my suspicion. I encountered this issue while trying to load a 3DTiles tileset using Cesium for Unity.

If anyone with a dev environment for cesium-native set up could test that, this would be very helpful.
Adding the following code to line 98 of `CesiumUtility/test/TestUri.cpp` might save you some time:

```cpp
CHECK(
CesiumUtility::Uri::resolve("file:///C:/Temp/3d%20tiles", "tiles/1") ==
"file:///C:/Temp/3d%20tiles/tiles/1");
```

By the way, for some reason if the base URI is `file:///C:/Temp/3dtiles/tileset.json` (assuming this path is correct) and the relative path is `tiles/1` it still finds the right files somehow, despite ending up with what I expect is a URI to a subfolder of a file, which can't be right. Does anyone have any idea how?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.