为什么在写入控制台时我的系统发出蜂鸣声 [英] Why does my system beep when writing to Console

查看:173
本文介绍了为什么在写入控制台时我的系统发出蜂鸣声的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在为我的应用程序中使用的Web服务编写一个控制台测试程序。当我写输出到我的控制台(JSON)足够大的控制台应用程序旋转,我开始得到一个蜂鸣声5-10秒。我检查了一个\a的输出,找不到一个,所以我不知道是什么引起了嘟嘟声。



在这一点上,我只是猜测

解决方案

即使您检查了对于BELL字符的输入,它可能仍然发出哔声。这是由于字体设置和unicode转换。相关字符为 U + 2022 ,项目符号。 p>

Raymond Chen 说明


在OEM代码页中,项目符号字符将转换为
哔声。但是为什么呢?



你看到的是MB_USEGLYPHCHARS。 Michael Kaplan
前面讨论过MB_USEGLYPHCHARS。它确定在转换为Unicode时,某些
字符是否应被视为控制字符或可打印的
字符。例如,它控制
是否应将ASCII铃声字符0x07转换为
Unicode铃声字符U + 0007或Unicode项目符号U + 2022。你
需要MB_USEGLYPHCHARS标志来决定当
转换为Unicode时要走哪条路,但是当
从Unicode转换时没有相应的歧义。从Unicode转换时,U + 0007和
U + 2022都映射到ASCII字符。



I am writing a console tester for a web service that I am using in my app. When I write the output to my console(JSON) for a large enough set the console app spins and I start getting a beeping noise for 5-10 seconds. I checked the output for a \a and couldn't find one, so I'm not sure what is causing the beeping.

At this point I am just guessing the long output, but I am unsure what else the problem could be or if there are any solutions.

解决方案

Even if you check the input for BELL characters, it may still beep. This is due to font settings and unicode conversion. The character in question is U+2022, Bullet.

Raymond Chen explains:

In the OEM code page, the bullet character is being converted to a beep. But why is that?

What you're seeing is MB_USEGLYPHCHARS in reverse. Michael Kaplan discussed MB_USEGLYPHCHARS a while ago. It determines whether certain characters should be treated as control characters or as printable characters when converting to Unicode. For example, it controls whether the ASCII bell character 0x07 should be converted to the Unicode bell character U+0007 or to the Unicode bullet U+2022. You need the MB_USEGLYPHCHARS flag to decide which way to go when converting to Unicode, but there is no corresponding ambiguity when converting from Unicode. When converting from Unicode, both U+0007 and U+2022 map to the ASCII bell character.

这篇关于为什么在写入控制台时我的系统发出蜂鸣声的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆