-
Notifications
You must be signed in to change notification settings - Fork 584
Closed
Description
Description
When I use python main.py, this is correct, but when i use flet run .\main.py, this program cannot print chinese
Code example to reproduce the issue:
import flet as ft
def main(page: ft.Page):
page.title = "One"
page.theme_mode = ft.ThemeMode.LIGHT
def nav_on_change(e: ft.control_event.ControlEvent):
print("中文")
match e.data:
case "0":
print("one")
case "1":
print("two")
case "2":
print("three")
case _:
print("other")
page.navigation_bar = ft.NavigationBar(destinations=[
ft.NavigationDestination(icon=ft.icons.EXPLORE, label="Explore"),
ft.NavigationDestination(icon=ft.icons.COMMUTE, label="Commute"),
ft.NavigationDestination(
icon=ft.icons.BOOKMARK_BORDER,
selected_icon=ft.icons.BOOKMARK,
label="Explore",
),
], bgcolor=ft.colors.GREEN_50, elevation=1, label_behavior=ft.NavigationBarLabelBehavior.ALWAYS_HIDE,
on_change=nav_on_change)
page.add(
ft.Text("Body"),
ft.ElevatedButton(text="打印中文", on_click=lambda _: print("中文"))
)
if __name__ == '__main__':
ft.app(target=main)Describe the results you received:
Describe the results you expected:
Additional information you deem important (e.g. issue happens only occasionally):
Flet version (pip show flet):
Version: 0.4.0.dev988
Operating system:
WIndows
Additional environment details:
Metadata
Metadata
Assignees
Labels
No labels

