惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LINUX DO - 最新话题
A
Arctic Wolf
I
Intezer
V
Vulnerabilities – Threatpost
C
Cisco Blogs
MyScale Blog
MyScale Blog
NISL@THU
NISL@THU
Y
Y Combinator Blog
C
CERT Recently Published Vulnerability Notes
P
Privacy International News Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
Recorded Future
Recorded Future
云风的 BLOG
云风的 BLOG
S
SegmentFault 最新的问题
Microsoft Security Blog
Microsoft Security Blog
L
LangChain Blog
博客园 - 聂微东
博客园 - 叶小钗
F
Fortinet All Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Recent Announcements
Recent Announcements
C
Cyber Attacks, Cyber Crime and Cyber Security
Latest news
Latest news
Simon Willison's Weblog
Simon Willison's Weblog
P
Palo Alto Networks Blog
S
Schneier on Security
C
Cybersecurity and Infrastructure Security Agency CISA
V
V2EX
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
The Hacker News
The Hacker News
博客园 - 司徒正美
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LINUX DO - 热门话题
罗磊的独立博客
K
Kaspersky official blog
Last Week in AI
Last Week in AI
Know Your Adversary
Know Your Adversary
小众软件
小众软件
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
D
DataBreaches.Net
Scott Helme
Scott Helme
P
Proofpoint News Feed
P
Privacy & Cybersecurity Law Blog
P
Proofpoint News Feed
博客园 - 三生石上(FineUI控件)
Hugging Face - Blog
Hugging Face - Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Full Disclosure

for_the_zero的个人博客

WebTooys第4弹更新 —— AI知识图谱Oheya、连接选择器Selinkt、长图拼接、LessChat、生成终末地配方AI提示词 - for_the_zero的个人博客 ZapStartTab - 只是专注于打开网页的简陋新标签页 - for_the_zero的个人博客 将我的个人网站模板大改了一下 - for_the_zero的个人博客 小想法2——如何让AI拥有生命? - for_the_zero的个人博客 vAIbe - 用Vibe Coing做一个AI? - for_the_zero的个人博客 个人网站更新! - for_the_zero的个人博客 WebTooys第3.5弹更新 —— GPT/RSVP阅读器、抠图工具、QQ空间导出记录查看器、摄像头画面AI生成颜文字 - for_the_zero的个人博客 科技杂谈1:从系统到AI,从软件到互联网 - for_the_zero的个人博客 记录一下我的小想法 - for_the_zero的个人博客 教程:怎么在U盘上装一个便携版的MC? - for_the_zero的个人博客 整理一下域名 - for_the_zero的个人博客 WebTooys Quicktools 第三弹:AI记事本输入法、剪贴板图片保存、AI驱动的虚拟文章平台FakeNET…… - for_the_zero的个人博客 如何注册一个免费的.is-a.dev域名? - for_the_zero的个人博客 新的个人网站上线! - for_the_zero的个人博客 MapPinner: 在地图上留下自己旅行时走过之处的标记 - for_the_zero的个人博客 自制软件LMCanvas —— 让界面与模型交互 - for_the_zero的个人博客 asak - 一个适应速率限制的大模型api调用工具 - for_the_zero的个人博客 又是英语演讲 - for_the_zero的个人博客 往我自己做的简约表格加了一点AI - for_the_zero的个人博客 Free-LLM-Collection - 一个分享关于免费的大模型API的地方 - for_the_zero的个人博客 Quicktools第2.1弹 - 文本展示工具、UP主动态查看工具 - for_the_zero的个人博客 Quicktools第二弹 - 按键转写、音频转颜色、简约风表格工具 - for_the_zero的个人博客 分享一下我最近为英语演讲写的演讲搞(整活) - for_the_zero的个人博客 CapsTools - 一个利用大写锁定键触发的工具箱 - for_the_zero的个人博客 第一批Quicktools小工具来啦 - for_the_zero的个人博客 相机算法对比:vivo vs Google - for_the_zero的个人博客 国产大模型对比! - for_the_zero的个人博客 一个提取手机apk的玩意 - for_the_zero的个人博客 一个手机硬件状态监控的玩意 - for_the_zero的个人博客 AlanBecker视频列表:关注视频更新动态! - for_the_zero的个人博客 一段时间前做了一个DNA打结的东西 - for_the_zero的个人博客 做了个叫PinCopy的玩意 - for_the_zero的个人博客 记一下自己写tttpro - for_the_zero的个人博客 在scratch实现简单纯画笔排版 - for_the_zero的个人博客 如何在scratch简单实现拼音输入法 - for_the_zero的个人博客 Blog Post - for_the_zero的个人博客 一种迷宫的介绍 - for_the_zero的个人博客 DearPyGui笔记 - for_the_zero的个人博客
发现bug,连甩两层锅 - for_the_zero的个人博客
for_the_zero · 2024-01-23 · via for_the_zero的个人博客

刚刚正在开发时突然出现一个问题

(图片中的已修复

使用文件/目录选择窗口的时候无法使用中文字形,而相同配置的其它窗口没有这个问题

我排查了很久,自习看过了文档,尝试过各种方式,都不行

准备去Github看看,发现还真有一样遭遇的,开发者也回复了,还标注了高优先级,但依旧Open

Chinese path support for select_directory_dialog · Issue #299 · hoffstadt/DearPyGui

但事情没那么简单

程序的调用

1

楼主很快找到了问题所在,不是我的错,不是DPG的错,是imgui的错

找是找到了,但不知道怎么改

hoffstadt: This appears to be an issue related to ImGuiFileDialog. Still looking into it more.

开发者:好像与ImGuiFileDialog有关,在进一步调查

hoffstadt: Should work in 0.7!

开发者:0.7应该就行了!

至于我,更新一下这个包就行了,太久没更新过了

确实,像上面的图那样,成了

2

0.8又没了……

至少MacOS上的韩文出了问题

这可难不倒!

一个u8string就搞定了

u8应该是指utf-8吧。这么说,没有支持utf-8?怎么会这样

3

完了?还没呢!

测试的时候发现:中文文件夹打不开、选中直接卡死闪退,以前还是正常的

已经有人帮我问了,这是第二次重新Open了(有完没完

目前还没有回复,而它连接到了另一个issues

Application crashes when file_dialog path encounters characters like æ ø å · Issue #2057 · hoffstadt/DearPyGui

一个叫v-ein的贡献者分析了一下:

It crashes in mvFileDialog::getInfoDict(), in the very first call to PyDict_SetItemString(), which extracts file name from ImGuiFileDialog and feeds it into ToPyString() (and consequently PyUnicode_FromString()):

PyDict_SetItemString(dict, "file_path_name", mvPyObject(ToPyString(_instance.GetFilePathName())));

The problem is, GetFilePathName() returns an ANSI-encoded (single-byte) string, whereas PyUnicode_FromString() expects a UTF-8 strings and treats it as such. I believe it goes over the trailing zero or something like that. Or maybe it stumps upon an assertion of some kind and crashes.

I'm not sure whether ANSI-encoded strings are Windows-specific behavior or they show up on all platforms (I'd bet on Windows-specific). The bad news are, the file dialog doesn't even display such names correctly. That is, strings inside of file dialog must be UTF-8 rather than ANSI; it's a bug in ImGuiFileDialog and not in DPG. Not sure if we can fix it in ImGuiFileDialog though because it's a submodule repo - scratch that, even though it's a third-party library, it's committed directly into DPG. Technically we can fix it or even update ImGuiFileDialog from its source repo (if it works on old ImGui, that is).

简单总结一下:由于Windows先进的向(lì)下(shǐ)兼(yí)容(líu),路径用的是ANSI编码,所以GetFilePathName()返回的是ANSI编码字符串,而PyUnicode_FromString()期望的是UTF-8字符串,可能就在这里出问题了(但是他用了“认为”“可能”“或许”,具体原因他也不清楚)

AI烤肉:

这是ImGuiFileDialog中的错误,而不是DPG中的错误。不确定我们是否可以在ImGuiFileDialog中修复它,因为它是子模块仓库 - 打消这个念头,即使它是第三方库,但它直接提交到了DPG中。从技术上来说,我们可以修复它,甚至可以从ImGuiFileDialog的源仓库更新它(如果它在旧的ImGui上工作的话)

然后……然后就没了,现在都没有解决

为了把程序做出来,就不用它做界面了吧,决定用flet了