[GH-ISSUE #1039] [Issue]: NPC portrait generation fails for non-ASCII names #510

Closed
opened 2026-10-20 17:29:39 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @cha1latte on GitHub (May 20, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1039

Originally assigned to: @cha1latte on GitHub.

Summary

NPC portrait/avatar generation in game mode can fail for non-English names because safeName strips non-ASCII characters and returns an empty slug.

Source Discord thread: https://discord.com/channels/1417099416812392641/1480379733173731458/threads/1506413662456516758

Reporter: GREGOR OVECH

Expected behavior

Game mode asset generation should generate safe filenames/slugs for NPC names in languages that use non-ASCII characters, or otherwise fall back to a stable non-empty name.

Actual behavior

When output uses another language, safeName can return an empty string. generateNpcPortrait then returns null, so avatars are not generated for NPCs.

Steps to reproduce

  1. Use game mode with model output in a non-English language / non-ASCII NPC names.
  2. Trigger NPC portrait generation.
  3. Observe that safeName(req.npcName) returns an empty slug.
  4. Observe that generateNpcPortrait returns null and no NPC avatar is generated.

Marinara Engine version

Not specified.

Install type

Not specified.

OS + version

Not specified.

Browser or app shell

Not specified.

Screenshots or video

Not a visual/UI issue.

Logs

Relevant code from the report:

function safeName(name: string): string {
  return name
    .toLowerCase()
    .replace(/[^a-z0-9]+/g, "-")
    .replace(/(^-|-$)/g, "");
}

export async function generateNpcPortrait(req: NpcPortraitRequest): Promise<string | null> {
  const slug = safeName(req.npcName);
  if (!slug) return null;
}

Additional context

The reporter suggested using a library or other approach to generate safe names for non-English names.

Template check

  • I provided the required summary, behavior, reproduction, and environment details.
  • If this is a visual/UI bug, blank screen, layout issue, mobile/responsive issue, incorrect image or sprite, broken animation, or unexpected error state, I attached screenshots or video.
Originally created by @cha1latte on GitHub (May 20, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1039 Originally assigned to: @cha1latte on GitHub. ## Summary NPC portrait/avatar generation in game mode can fail for non-English names because `safeName` strips non-ASCII characters and returns an empty slug. Source Discord thread: https://discord.com/channels/1417099416812392641/1480379733173731458/threads/1506413662456516758 Reporter: GREGOR OVECH ## Expected behavior Game mode asset generation should generate safe filenames/slugs for NPC names in languages that use non-ASCII characters, or otherwise fall back to a stable non-empty name. ## Actual behavior When output uses another language, `safeName` can return an empty string. `generateNpcPortrait` then returns `null`, so avatars are not generated for NPCs. ## Steps to reproduce 1. Use game mode with model output in a non-English language / non-ASCII NPC names. 2. Trigger NPC portrait generation. 3. Observe that `safeName(req.npcName)` returns an empty slug. 4. Observe that `generateNpcPortrait` returns `null` and no NPC avatar is generated. ## Marinara Engine version Not specified. ## Install type Not specified. ## OS + version Not specified. ## Browser or app shell Not specified. ## Screenshots or video Not a visual/UI issue. ## Logs Relevant code from the report: ```ts function safeName(name: string): string { return name .toLowerCase() .replace(/[^a-z0-9]+/g, "-") .replace(/(^-|-$)/g, ""); } export async function generateNpcPortrait(req: NpcPortraitRequest): Promise<string | null> { const slug = safeName(req.npcName); if (!slug) return null; } ``` ## Additional context The reporter suggested using a library or other approach to generate safe names for non-English names. ## Template check - [ ] I provided the required summary, behavior, reproduction, and environment details. - [ ] If this is a visual/UI bug, blank screen, layout issue, mobile/responsive issue, incorrect image or sprite, broken animation, or unexpected error state, I attached screenshots or video.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#510
No description provided.