AllTalk TTS: Czech diacritics lost (non-UTF8 form encoding in request)

Open
#10,133 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
csharp
Domain
api

Research direction

Start at the AllTalk TTS integration and trace the POST request sent to /api/tts-generate, comparing its form-body encoding and Content-Type with the working PowerShell request. Reproduce with the Czech sample text and verify that AllTalk receives and preserves ř, č, ž, and other diacritics.

Written by the indexing model from the issue text.

Description

Subtitle Edit version: [Subtitle Edit 4.0.14]
Windows: [doplň verzi - např. Windows 10 22H2]
AllTalk: [v1.9c] running on http://127.0.0.1:7851
TTS Engine: AllTalk TTS (Coqui XTTSv2 based)
Language: Czech (cs)

Problem

When generating TTS via AllTalk from Subtitle Edit, Czech diacritics (ř, č, ž, etc.) are corrupted.

Example input in Subtitle Edit:

Takže čeština tu funguje suprově, co ty tomu říkáš?

What AllTalk receives (visible in console log):

Take etina tu funguje suprov, co ty tomu íká?

However, AllTalk itself handles Czech correctly when called directly via API.

Evidence / Reproduction

Calling AllTalk API directly via PowerShell works correctly and preserves diacritics:

$body = @{
  text_input           = "Takže čeština tu funguje suprově, co ty tomu říkáš?"
  text_filtering       = "none"
  character_voice_gen  = "female_01.wav"
  narrator_enabled     = "false"
  narrator_voice_gen   = "male_01.wav"
  text_not_inside      = "character"
  language             = "cs"
  output_file_name     = "ps_test"
  output_file_timestamp= "true"
  autoplay             = "false"
  autoplay_volume      = "0.8"
}

Invoke-RestMethod -Method Post `
  -Uri "http://127.0.0.1:7851/api/tts-generate" `
  -ContentType "application/x-www-form-urlencoded; charset=utf-8" `
  -Body $body
...

AllTalk console output (correct):

[AllTalk TTSGen] Takže čeština tu funguje suprově, co ty tomu říkáš?

Root Cause (suspected)

Subtitle Edit likely encodes the POST request body using the system codepage
(Encoding.Default / CP-1250) instead of UTF-8 when sending
application/x-www-form-urlencoded data, causing non-ASCII characters
to be corrupted before reaching AllTalk.

Suggested Fix

Ensure UTF-8 encoding is used for application/x-www-form-urlencoded POST bodies
and explicitly set Content-Type: application/x-www-form-urlencoded; charset=utf-8
in the HTTP request headers.

Related

Similar encoding issues have been reported in:

  • #3384
  • #8686
Dominant language
C#
Stars
14.3k
Forks
1.3k
Avg merge
1h 19m
Merged PRs (30d)
782

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SubtitleEdit/subtitleedit

All issues in SubtitleEdit/subtitleedit

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.