PST AddSubFolder non-ASCII

PersonalStorage.RootFolder.AddSubFolder(“Inbox\العربية”, True)
will result in:

Failed to create the folder. The folder with same name already exists.
Seems that when using non-ASCII characters in the subfolder names, Aspose can’t parse them correctly!

Is this kinda issue or need some special pre-process?
Thank you :slight_smile:,

I cannot reproduce this. My code:

var pst = PersonalStorage.Create(@"test.pst", FileFormatVersion.Unicode);
pst.RootFolder.AddSubFolder(@"Inbox\العربية", true);

And the screenshort of my pst from Outlook: out.png (957 Bytes)

1 Like

Hello and thank you, also sorry for the inconvenience, ok seems a bit complex, I’m getting the folder name from this method (another sdk):

It automatically decodes international folder names presented in UTF-7 Modified encoding (see IMAP4 protocol specification in RFC3501 for details on UTF-7 Modified encoding). However, the original name (not decoded from UTF-7 Modified) is still available via RawName property.

Do you think this is causing the problem? passing UTF-7 Modified encoding name to Aspose AddSubFolder method?
Does AddSubFolder method need UTF-8 encoded etc?
Thanks :slight_smile:

Ok I have created a sample project that reproduce this error.
I’ve copied the text from server log to the project.
Thank you :slight_smile: (3.8 MB),

That’s not the problem at all. You first create

Dim MyInbox As Pst.FolderInfo = MyPstWriter.CreatePredefinedFolder("Inbox", StandardIpmFolder.Inbox)

And then you try to create a folder hierarchy with the same Inbox name.

MyRests = MyPstWriter.RootFolder.AddSubFolder("INBOX\العربية", True)

Replace the line above with the following

MyRests = MyInbox.AddSubFolder("العربية")

Or add code to check if the same folder exists.

Outlook is not case sensitive and will not allow you to add a folder with the same name but in a different case.

Hello and thanks, but, objection; let’s argue on the behavior!
This is not quite right considering this specific overload’s goal: to make folder hierarchy!

Almost anywhere in Windows/FTP SDKs I’ve seen that if:
exists or not, adding:
Will make the inner folder anyway, if outer folder exists, will be made inside, otherwise both will be made!

When Folder1 exists, a request to make Folder1\Folder2 should not return “Folder already exists” error, IMO.
If you think it’s wise to your logic, you may consider it as an improvement!

My case: I am sending AddSubFolder requests inside a loop of reading remote imap server.
A bit complex to gain control over it, so I will check the target pst folder existence:

So regardless of your decision, please help me make wih the general idea of an algorithm of a function to get the PersonalStorage and full folder path (to be created inside Pst) and make it anyway.

Here’s my sample, which is of course is a terrible way to go, that’s why I asked your kind help for an efficient algorithm, anyway, it also shows that I could make 2 folders in the root with the same name but different cases! (3.8 MB)

OK there’s a problem here:

PersonalStorage.RootFolder.AddSubFolder(“MyBox\2\العربية”, True)
PersonalStorage.RootFolder.AddSubFolder(“MyBox\2\2\العربية”, True)
PersonalStorage.RootFolder.AddSubFolder(“MyBox\2\العربية\العربية”, True)

These set of commands will work with no problem, even if the root folder “MyBox” pre-exists!

The problem happens when the root folder is one of those pre-defined ones, otherwise the hierarchy overload works fine!

I say the best way is to fix it internally :frowning:
How do you think?

We have opened the following new ticket in our internal issue tracking system
Issue ID(s): EMAILNET-41030.

1 Like

Thanks, is it considered as a bug? (I’m sure it is) and considered as a preventing/blocking high priority one?

Anyway, there’s another issue here:
Load the sample Pst and try to select the already existing folder by:

Dim PstFI As Pst.FolderInfo = PersonalStorage.RootFolder.GetSubFolder(“INBOX\2\2\العربية”, True)
PstFI will be blank!

Even if you try to get “INBOX\2” still a failure!
Issue in GetSubFolder? (18.5 KB),

Added additional info above to the ticket.

1 Like

Any chance for 22.5? :frowning:,

Yes, there is a high probability

1 Like