简体   繁体   中英

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. The folder name is having some unicode characters. If try to I set the name I am getting error as

""Notes error: Name too long (DifferentlanguagesÜðĂþÖÖ~VV¶ñí暎šäâΤø˙Ÿœ€…„∏ĆıœšŽÞÚ)"

The folder name limit of lotus notes is 64 character but this string is having 54 characters

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¶ñí暎šäâΤø˙Ÿœ€…„∏ĆıœšŽÞÚ)"

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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