Skip to content

Percent symbol escaped %% is not rendered propely by PR_DEBUG #471

@ve2opn

Description

@ve2opn

Following:
PR_DEBUG("🌡️ DHT22: T=%d.%d°C, H=%d.%d%%", temp_x10 / 10, temp_x10 % 10, humi_x10 / 10, humi_x10 % 10);
is rendered by terminal:
[12-20 22:51:28 ty D][tuya_main.c:811] 🌡️ DHT22: T=19.8°C, H=42.3[0m

Example workarounds:
Use a Unicode replacement like ﹪ - Small percent sign (U+FE6A) or % (U+FF05 - Full-width Percent).
PR_DEBUG("🌡️ DHT22: T=%d.%d°C, H=%d.%d﹪" ...
The character specifier, as : printf("%c", '%'); does not work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions