X Tutup
Skip to content

Fix Unicode corruption in sample YAML name generation#570

Merged
sinaatalay merged 2 commits intorendercv:mainfrom
Sikriet:fix/sample-generator-unicode-encoding
Dec 23, 2025
Merged

Fix Unicode corruption in sample YAML name generation#570
sinaatalay merged 2 commits intorendercv:mainfrom
Sikriet:fix/sample-generator-unicode-encoding

Conversation

@Sikriet
Copy link
Contributor

@Sikriet Sikriet commented Dec 23, 2025

Summary

Fixes a bug that mangled non-ASCII characters in the name field of the sample YAML produced by rendercv new (for example, "Matías" became "Matías").

Root cause

An unnecessary encode/decode using "unicode-escape" in the sample generator caused UTF-8 bytes to be mis-decoded. The problematic code was in sample_generator.py.

What I changed

Removed the incorrect transformation:

name = name.encode().decode("unicode-escape")

And assigned the provided name directly to the model.

Tests / Verification

Added unit test: test_creates_model_with_unicode_name

Ran the sample-generator tests to ensure no regressions.

Impact

Backward-compatible bugfix.

Fixes the rendercv new YAML output.

Fixes any generated filenames using the name placeholder.

How to reproduce / validate locally

Run rendercv new and provide a name with accents (e.g., "Matías", "José", etc).

Check the generated .yaml file to ensure the name is rendered correctly.

Run the test suite: just test

@mgaitan
Copy link

mgaitan commented Dec 23, 2025

I, Martín Gaitán, on behalf of all people around the world whose names contain non-ASCII characters, thank you for this fix.

@sinaatalay sinaatalay merged commit 1d9deda into rendercv:main Dec 23, 2025
11 checks passed
@sinaatalay
Copy link
Member

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup