Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Well, my question was a little bit tricky. But I finally found an answer and will share it here.</p> <p>What I suspected was true : Windows uses UTF-16 (little endian) urls. It makes no differences working in UTF-8 when we only use paths to files such as images, text, etc. But to be able to access Outlook items, we must use UTF-16LE. If I were coding in C#, there wouldn't have been any problem. But in Java, you have to be more inventive.</p> <p>From Windows Desktop Search, I retrieve this:</p> <pre><code>mapi://{S-1-5-21-1626573300-1364474481-487586288-1001}/toto@mycompany.com($b423dcd5)/0/Inbox/가가가가곕갘객겒갨겑곓걌게겻겨곹곒갓곅갩갤가갠가 </code></pre> <p>And what I did is creating a temporary VB script and run it like this:</p> <pre><code>/** * Opens a set of items using the given set of paths. */ public static void openItems(List&lt;String&gt; urls) { try { // Create VB script String script = "Sub Run(ByVal sFile)\n" + "Dim shell\n" + "Set shell = CreateObject(\"WScript.Shell\")\n" + "shell.Run Chr(34) &amp; sFile &amp; Chr(34), 1, False\n" + "Set shell = Nothing\n" + "End Sub\n"; File file = new File("openitems.vbs"); // Format all urls before writing and add a line for each given url String urlsString = ""; for (String url : urls) { if (url.startsWith("file:")) { url = url.substring(5); } urlsString += "Run \"" + url + "\"\n"; } // Write UTF-16LE bytes in openitems.vbs FileOutputStream fos = new FileOutputStream(file); fos.write(script.getBytes("UTF-16LE")); fos.write(urlsString.getBytes("UTF-16LE")); fos.close(); // Run vbs file Runtime.getRuntime().exec("cmd.exe /C openitems.vbs"); } catch(Exception e){} } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload