Bentley Communities
Bentley Communities
  • Site
  • User
  • Site
  • Search
  • User
ProjectWise
  • Product Communities
ProjectWise
ProjectWise Design Integration Forum The definitive guide to why pasted URLs/URNs frequently don't work, but sometimes do
    • Sign In

    • State Verified Answer
    • +4 person also asked this people also asked this
    • Replies 20 replies
    • Subscribers 66 subscribers
    • Views 11406 views
    • Users 0 members are here

    The definitive guide to why pasted URLs/URNs frequently don't work, but sometimes do

    Kevin van Haaren
    Offline Kevin van Haaren over 4 years ago

    TL;DR version: Some Office 2016 products seem to have changed how it treats URLs pasted into it's products. I'm not sure when this update occured, or if other apps do similar things. I've tested this with Word, One Note and Outlook 2016.

    Office 2016 seems to convert URLs pasted into them by percent encoding the URL. It ignores HTML encoded characters. ProjectWise URNs use braces that are always converted by Office 2016 to their percent encoded versions. Paths using spaces and copied from PW using the normal Copy command (or ctrl-c) in the address bar will also have problems.  Using Copy URL should work for paths with spaces (the spaces are HTML encoded to &space;) but may have problems with "weird" characters that doen't have HTML encoded versions.

    Gory detail version:

    Testing ProjectWise Explorer 10.00.03.140 with One Note 2016, Outlook 2016 and Word 2016

    There are 2 methods of encoding "weird" characters for use in URL and/or HTML. Percent encoding is technically the version you should use for URL, URI and URNs. Bentley does this when you right-click the address bar and select Copy or Copy URN.  If you get the actual link (right-click on the link and select Copy Link) and paste in notepad you'll see this encoding for spaces using %20, open brace as %7b and close brace as %7d.

    https://en.wikipedia.org/wiki/Percent-encoding

    HTML entity encoding uses an ampersand, and entity name, and a semi-colon. You'll see this for spaces as &space; or less than as <. ProjectWise uses this method when you right-click a file and select Copy URL.

    https://en.wikipedia.org/wiki/HTML_encoding

    I wasn't explicit above but there are 4 ways to copy a link from ProjectWise:

    1. Select the address bar contents, Ctrl+C
    2. Select the address bar contents, right-click select Copy (just Copy)
    3. Right-click the address bar, select Copy URL
    4. Right-click the address bar, select Copy URN

    Methods 1, 2 and 4 use percent encoding . Method 3 uses HTML entity encoding.

    If you select a file where the path has no "weird" characters (i.e. no spaces, no semi-colons, no ampersands, no percent signs) then methods 1, 2, and 3 will work fine. Method 4 will fail.

    If you select a file with spaces in the path (or any other characters that can be HTML encoded)  then method 1, 2 and 4 will fail. Method 3 will work.

    Method 4 always fails because URNs contain braces around the GUID and they are always percent encoded.

    You can see how Office changes the encoding by doing the following:

    In ProjectWise Explorer right-click the address bar and select Copy URN.

    Open Notepad and paste into Notepad. You'll see the URN version has the braces are normal brace characters.

    Paste into Word

    Right-click the link in Word, select Copy Hyperlink

    Paste that into Notepad

    Now you'll see the URL has changed so { is %7b and } is %7d

    Even if you edit the hyperlink in word to undo the percent encoding it will change it back.

    • Sign in to reply
    • Cancel

    Top Replies

    • Phil Conard
      Offline Phil Conard Mon, Dec 3 2018 4:58 PM +1
      There will be a release of PW Explorer in the next few weeks that will have a fix for this issue. It will be a new version of the update 3.1 client.
    • Phil Conard
      Offline Phil Conard Mon, Jan 14 2019 3:38 PM in reply to Kevin van Haaren +1 verified
      Yes, it included Civil 3D 2019 as well. The autocad and civil 3d modules are delivered as one add-in module.
    • Kevin van Haaren
      0 Offline Kevin van Haaren Tue, Jun 30 2020 11:45 AM in reply to Juan Miller

      This doesn't work for exporting files from projectwise.

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Juan Miller
      0 Offline Juan Miller Tue, Jun 30 2020 10:25 AM

      Long Path Tool will let you easily delete, copy or rename long path files.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Rene Lloyd
      0 Offline Rene Lloyd Wed, Jan 16 2019 6:50 AM in reply to Rene Lloyd

      When clicking on the links in Excel 2016 MSO or Word 2016 (16.0.6925.1041) 64-bit, Windows 7, the link calls PW Explorer (pwc) and works.

      but in Excel Office 365 MSO(16.0.10730. 20264) 64-bit, Windows 10, the link calls PW Explorer (pwc) and is not understood, giving the Failed to compile a moniker from give n string error.

      The behaviour in Office seems to be the same - the brackets are percent encoded automatically both in Office 2016 and in Office 365. And the PW Explorer is the same, so the difference would seem to be between Windows 7 and Windows 10.

      But the connection defined in Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Classes\pw is the same.

      There is a parameter "UseOriginal UrlEncoding"=dword:00000001 that is supposed to disable URL percent decoding. It doesn't seem to have any effect changing this to 0. And in any event if both Office and Explorer call the same pw\shell\open\command why do they behave differently ?

      The PWC log does not show what the string was before raising Error 50000 "Failed to compile a moniker from given string” even with all logs at Debug. And there is no sign of the error in the server log.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Rene Lloyd
      0 Offline Rene Lloyd Tue, Jan 15 2019 6:19 AM in reply to Kevin van Haaren

      Hi Kevin - Have you tried links from Word and Excel in Office 365 / Office 2016? As far as I can see, these still fail with Failed to compile a moniker from given string.because they send the % codes directly to the client, whereas if you paste the links into any kind of HTML they work correctly.

      René

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Rene Lloyd
      0 Offline Rene Lloyd Tue, Jan 15 2019 5:09 AM in reply to Phil Conard

      I have installed 03.167, and I still get Failed to compile a moniker from given string when cicking on links from Excel Office 365 MSO(16.0.10730.20264) 64-bit. This is because Excel changes the brackets to percent codes.

      Was this error supposed to fixed ?

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    >

    Communities
    • Home
    • Getting Started
    • Community Central
    • Products
    • Support
    • Secure File Upload
    • Feedback
    Support and Services
    • Home
    • Product Support
    • Downloads
    • Subscription Services Portal
    Training and Learning
    • Home
    • About Bentley Institute
    • My Learning History
    • Reference Books
    Social Media
    •    LinkedIn
    •    Facebook
    •    Twitter
    •    YouTube
    •    RSS Feed
    •    Email

    © 2023 Bentley Systems, Incorporated  |  Contact Us  |  Privacy |  Terms of Use  |  Cookies