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

GLTFLoader: Assets with url-encoded UTF8 characters in filenames don't load correctly #29963

Open
hybridherbst opened this issue Nov 25, 2024 · 0 comments
Labels

Comments

@hybridherbst
Copy link
Contributor

Description

While tackling various internationalization issues with glTF assets I made a few new test assets:

In general, three.js fares second-best of the viewers I tested, but one asset doesn't load at all, thus this report.

Reproduction steps

See live example or code.

This URL works: https://raw.githubusercontent.com/prefrontalcortex/glTF-Sample-Assets/sample/relativeUris/Models/UriTest/glTF-UriTest-01-RelativeTexture-NoUTF8/RelativeResourcePaths.gltf

This URL does not work: https://raw.githubusercontent.com/prefrontalcortex/glTF-Sample-Assets/sample/relativeUris/Models/UriTest/glTF-UriTest-02-RelativeTexture-UTF8/RelativeResourcePaths.gltf

Here's ZIP files of the assets:

glTF-UriTest-01-RelativeTexture-NoUTF8.zip
glTF-UriTest-02-RelativeTexture-UTF8.zip

Both assets pass the glTF Validator and load in e.g. UnityGLTF or glTFast. Other viewers also have issues with URL-encoded UTF8 characters in path names.

Code

const loader = new GLTFLoader();
    loader.load(
    	// Working URL (non-UTF8):
      // 'https://raw.githubusercontent.com/prefrontalcortex/glTF-Sample-Assets/sample/relativeUris/Models/UriTest/glTF-UriTest-01-RelativeTexture-NoUTF8/RelativeResourcePaths.gltf',
      // Broken URL (UTF8):
      'https://raw.githubusercontent.com/prefrontalcortex/glTF-Sample-Assets/sample/relativeUris/Models/UriTest/glTF-UriTest-02-RelativeTexture-UTF8/RelativeResourcePaths.gltf',
      // called when the resource is loaded
      function ( gltf ) {
        scene.add( gltf.scene );
      }
    );

Live example

https://jsfiddle.net/st52uj40/10/

Screenshots

image

Version

latest

Device

No response

Browser

No response

OS

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants