Skip to content

Non-ASCII texture set and project names are lost in exported file names #855

Backlog

Description

@MorionTutoriales

Labels: bug, file-compat, i18n

What happens

sanitize_file_stem (crates/formats/src/export/mod.rs) keeps only [A-Za-z0-9_.-] and replaces everything else with _.

  • Accented names lose letters: a texture set Óxido exports as _xido_BaseColor.png.
  • Names written fully in other alphabets collapse to underscores. Two texture sets with names of the same length,
    such as 身体 and 头发, both become __. The export keeps the first file and skips the second one
    with the warning "was not written: an earlier file of this export has the same name"
    (crates/engine/src/file_cmds.rs). The second set's textures are not exported.

The reference app writes Unicode file names. Users who name materials in their own language get broken
or missing exports, although the interface is offered in ten languages.

Steps

  1. Import a mesh with two materials named 身体 and 头发 (or rename the texture sets).
  2. Export textures with the default template.
  3. Only one set's maps are written; the other set's maps are reported as duplicates.

Expected

Exported names keep letters from any script. Only characters that file systems reject
(<>:"/\|?*, control characters, trailing dots and spaces, reserved device names) are replaced.

Notes

The same sanitizer names autosave files, USD/MaterialX companions, presets and templates, so a fix helps those too.
Resource names inside .tcraft (sanitize_resource_name) can stay ASCII, because those are ZIP entry names and are already deduplicated.

Activity

  1. MorionTutoriales commented on Nov 26, 2026

    @MorionTutoriales
    ContributorAuthor

    I'm taking this. Plan: keep letters and marks from any script in exported file names, keep today's rule for ASCII (so existing names don't change), replace control, Unicode space and bidi override characters, cap names by bytes as well as characters, and compare names case-insensitively beyond ASCII. @Rebornim, #827 touches the same sanitizer; I'll keep my change small there.

  2. added
    bugfix
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions