<html>
<head>
<base href="https://bugs.documentfoundation.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_UNCONFIRMED "
title="UNCONFIRMED - No documentation about proper conversion of system file names into URLs in Calc"
href="https://bugs.documentfoundation.org/show_bug.cgi?id=134896">134896</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>No documentation about proper conversion of system file names into URLs in Calc
</td>
</tr>
<tr>
<th>Product</th>
<td>LibreOffice
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>UNCONFIRMED
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>Documentation
</td>
</tr>
<tr>
<th>Assignee</th>
<td>libreoffice-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mikekaganski@hotmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>erack@redhat.com, olivier.hallot@libreoffice.org
</td>
</tr></table>
<p>
<div>
<pre>There is HYPERLINK function in Calc, that is documented [1] [2] to take
URL/IRI. There's also ENCODEURL [3] to properly URL-encode various strings.
Yet, the latter function is not enough to convert random system filepath into
proper file: URL on all platforms. E.g., on Windows, the conversion also
includes replacing backslashes '\' with forward-slashes '/'. A naive attempt to
concatenate "file://" with "c:\path to\file.ext" would result in invalid URL;
also concatenating "file://" with ENCODEURL("c:\path to\file.ext") is not
correct.
But in fact, LibreOffice does the magic of proper conversion of system
filepaths into URLs: clicking on a cell with
<span class="quote">> =HYPERLINK("c:\path to\file.ext")</span >
would result in attempt to open proper "file:///c:/path%20to/file.ext". The
magic happens in ScGlobal::OpenURL calling ScGlobal::GetAbsDocName.
I suppose it's worth mentioning that on HYPERLINK help page, to avoid users
trying to create file URLs in various wrong ways.
Refs: <a href="https://ask.libreoffice.org/en/question/255719/">https://ask.libreoffice.org/en/question/255719/</a>,
<a href="https://ask.libreoffice.org/en/question/142052/">https://ask.libreoffice.org/en/question/142052/</a>
[1]
<a href="https://help.libreoffice.org/6.4/en-US/text/scalc/01/04060109.html?DbPAR=CALC#bm_id9959410">https://help.libreoffice.org/6.4/en-US/text/scalc/01/04060109.html?DbPAR=CALC#bm_id9959410</a>
[2]
docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part2.html#__RefHeading__1018226_715980110
[3]
<a href="https://help.libreoffice.org/6.4/en-US/text/scalc/01/func_webservice.html?DbPAR=CALC#bm_id811517136840444">https://help.libreoffice.org/6.4/en-US/text/scalc/01/func_webservice.html?DbPAR=CALC#bm_id811517136840444</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>