简体   繁体   English

无法在.nsf文件中使用Unicode字符创建文件夹

[英]Unable to create folder in .nsf file with unicode characters

I'm using Interop.Domino.dll with lotus notes 8.5 following code in c# .net: I am creating new folder in Lotus Notes client. 我在Lotus Notes 8.5中使用Interop.Domino.dll,并在c#.net中使用以下代码:我正在Lotus Notes客户端中创建新文件夹。 The folder name is having some unicode characters. 文件夹名称包含一些Unicode字符。 If try to I set the name I am getting error as 如果尝试设置名称,我将收到错误消息

""Notes error: Name too long (DifferentlanguagesÜðĂþÖÖ~VV¶ñí暎šäâΤø˙Ÿœ€…„∏ĆıœšŽÞÚ)" “”注意错误:名称太长(不同语言ÜðĂþÖÖ〜VV¶ñí暎šä⤤ø˙Ÿœ€…„ ∏ĆıœšŽÞÚÞÚ)“

The folder name limit of lotus notes is 64 character but this string is having 54 characters Lotus Notes的文件夹名称限制为64个字符,但是此字符串包含54个字符

Here is my code 这是我的代码

NotesSeesion LotusNotesSession=new NoteSession();
LotusNotesSession.Initialize(null);
NotesDatabase Database=LotusNotesSession.GetDatabase("",FilePath,false);
Database.EnableFolder("DifferentlanguagesÜðĂþÖÖ~VV¶ñí暎šäâΤø˙Ÿœ€…„∏ĆıœšŽÞ);

//Exception "Notes error: Name too long (DifferentlanguagesÜðĂþÖÖ~VV¶ñí暎šäâΤø˙Ÿœ€…„∏ĆıœšŽÞÚ)" //异常“注释错误:名称太长(不同的语言ÜðĂþÖÖ〜VV¶ñí暎šäâΤø˙Ÿœ€…„ ∏ĆıœšŽÞÚÞÚ)”

The folder name limit of Lotus Notes is maybe 64 bytes and the folder name gets encoded in UTF-8, which results in 89 bytes for your string. Lotus Notes的文件夹名称限制可能是64 个字节 ,并且文件夹名称以UTF-8编码,因此字符串的长度为89个字节。

This happens frequently when programmers don't really pay attention to what they're doing or documenting. 当程序员没有真正注意他们在做什么或在记录文档时,经常会发生这种情况。 My guess is that this limit predates Unicode support in Lotus Notes and back when things were interpreted in a single-byte codepage it held true, but eventually UTF-8 was used to introduce Unicode support at that point, which reduces the number of available characters in a somewhat unpredictable manner. 我的猜测是,此限制早于Lotus Notes中的Unicode支持,而在单字节代码页中解释事物时,它仍然成立,但最终使用UTF-8引入了Unicode支持,这减少了可用字符的数量。以某种不可预测的方式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM