java RTFEditorKit 闭群问题
我大多数时候使用 java RTFEditorKit 将 RTF 转换为文本。有时,我会遇到一个文件,其中没有进行转换,而是得到以下信息:
java.io.IOException: Too much close-groups in RTF text 在 javax.swing.rtf.RTFParser.write(Unknown Source)
我浏览了互联网,但没有看到这个问题的现成解决方案。
还有其他人看到过这个并知道该怎么做吗?
谢谢你,
埃利奥特
I am using a java RTFEditorKit that converts RTF to text most of the time. Some times, I will encounter a file where instead of the conversion taking place, I get the following:
java.io.IOException: Too many close-groups in RTF text
at javax.swing.rtf.RTFParser.write(Unknown Source)
I've looked around the internet but don't see a ready solution to this problem.
Anybody else seen this and know what to do?
Thank you,
Elliott
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据代码,如果 RTF 中右大括号的数量多于左大括号的数量,则会抛出此异常。听起来您的文件可能格式错误。
这是抛出异常的代码:
According to the code, this exception will be thrown if you have more closing braces than opening braces in your RTF. Sounds like your file is probably malformed.
Here is the code which throws the Exception: