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 11442 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 Sat, Dec 1 2018 2:01 PM

      I had to edit this message as I misidentified this as a projectwise explorer bug when it's actually an Office 2016 bug. Ugh, sorry if you read the first version.

      Also, not a real fix for users but if you have powershell 5.1 on your machine you can copy a broken URL and then do:

      [System.Net.WebUtility]::URLDecode((get-clipboard)) | set-clipboard

      that will take whatever is on the clipboard, decode the percent encoding, then put the result back on the clipboard.

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Nathan Banks
      0 Offline Nathan Banks Mon, Dec 3 2018 6:57 AM in reply to Kevin van Haaren

      Win+R handles percent encoded pw links too.

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Mon, Dec 3 2018 10:08 AM in reply to Nathan Banks

      Oh, good call. I was going to mention I think it works if you paste into IE or Edge, but this is even better.

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Mon, Dec 3 2018 12:07 PM in reply to Nathan Banks

      whoops, i tested this on Windows 10 and it doesn't work for me. And neither does my thought of pasting into IE address bar

       

      • Cancel
      • Vote Up 0 Vote Down
      • Sign in to reply
      • Verify Answer
      • Cancel
    • Kevin van Haaren
      0 Offline Kevin van Haaren Mon, Dec 3 2018 12:08 PM in reply to Kevin van Haaren

      it does, however work in Windows 7.  UGH.

       

      • 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