IMAP header encoding

Hello everybody

I insert a IMAP header in the messages of my database named “id_pet_envio”.

When I do a search by this field in the messages with IMAP in a Java agent, I need search this field with the string “id$5Fpet$5Fenvio”.

I do the search with the next code from the package javax.mail:

IMAPFolder subfolder = (IMAPFolder)subfolders[j]

Folder folderInbox = subfolder.getFolder(“Inbox”);

SearchTerm st = new HeaderTerm(“id$5Fpet$5Fenvio”,“8394”);

Message msgs=folderInbox.search(st1);

folderInbox.close(true);

Knows anyone the encoding or character charset about the headers inserts with IMAP protocol?