eints allows submitting strings with disallowed UTF8 characters

Open
#43 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
34/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Start by reading the linked strgen block at src/strgen/strgen_base.cpp:735-740 and the referenced commit to understand which UTF-8 characters OpenTTD rejects. Then trace how eints validates submitted strings and compare its behavior for U+200B; done means eints rejects disallowed characters before they cause a build failure.

Written by the indexing model from the issue text.

Description

Specifically, U+200B (zero-width space)

Results in build failure:

  /home/runner/work/OpenTTD/OpenTTD/src/lang/japanese.txt:2405: FATAL: Unwanted UTF-8 character U+200B in sequence '{BLACK}道路の種類を変更/アップグレードします.Shiftは、コスト見積もりの​​作成/表示を切り替えます'

see https://github.com/OpenTTD/OpenTTD/commit/b721787c7fafbff040fbcaa188a9d5dd7557e26f

& associated block in strgen

https://github.com/OpenTTD/OpenTTD/blob/224625942c44ec33519010ae320b3821d933229a/src/strgen/strgen_base.cpp#L735-L740

Dominant language
Python
Stars
6
Forks
12
Avg merge
34m
Merged PRs (30d)
3

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

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 OpenTTD/eints

All issues in OpenTTD/eints

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.