Skip to content

In Japanese operating systems, the normal characters entered cannot still be displayed in the input box. #2665

Description

@nehonpa

Dear PyGui version:

2.3.1

Python version:

3.10

Operating system:

windows 11

My issue/question:

I found that even in the latest DPG 2.3.1, character input still cannot display correctly in the input box due to a system encoding issue, and it instead becomes "?".
This bug was discovered in a user running the Japanese Windows version, where the text could not display correctly when entering Chinese in the input box. Typing Japanese displays normally, and copying Chinese from the paste version into the input box also displays correctly.

Steps to reproduce:

  1. Please set your font file path.
  2. run code

Expected behavior:

Under normal circumstances, it will display the character normally, rather than "?".

Screenshots:

N/A

Image Image

Standalone, minimal, complete and verifiable example:

import dearpygui.dearpygui as dpg
import time
font = 'font_data/HANDotumLVT.ttf'
dpg.create_context()
with dpg.font_registry():
    with dpg.font(font,  24, tag='HANDotumLVT.ttf, 24px'):
        pass

with dpg.window(label='Main Window', tag='窗口_(1)', width=998, height=705):
    dpg.add_input_text(label='输入文字', tag='文本输入框')

dpg.bind_font("HANDotumLVT.ttf, 24px")
dpg.create_viewport(title='main_UI', width=1024, height=760,vsync=False)
dpg.setup_dearpygui()

dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions