Special characters within Tridion webdav URL’s

Obtaining an item from the Tridion database can either be done via Tridion TCM ID, or using the item webdav path. The latter is always the safest bet in the event the item has been deleted and recreated or the code is being moved over different environments but if the item name contains special characters you’ll need a resource which lists what they are .

When opening or obtaining an item via its webdav path you’ll need to be encoded to ensure the reference is correct.  Most common is the  space character as %20 but trying to remember all of them is an absolute nightmare.

Here is an example. The image below shows the Tridion CMS component that contains the special characters %, &,  ë and space :

tridion-component-webdav

To access this component the following webdav path should be used:

/webdav/<YOURPUBNAME>/Building%20Blocks/New%20%25%20%26%20Component%20%C3%AB.xml

Where  <YOURPUBNAME> is the name of the Tridion publication.

Anyway already with just these special characters the path is starting to look a little hairy so it’s probably for the best that you don’t use them, but in the event that you need to “translate” one then the following table will be incredibly useful.

Tridion CMS webdav special character table.

Code HTML Character Code HTML Character Code HTML Character
%20 space! %C3%A1 A %C3%8F Ï
%25 % %C3%AD í %C3%8C Ì
%C3%87 Ç %C3%B3 ó %C2%AF ¯
%C3%BC Ü %C3%BA ú %C3%93 Ó
%C3%A9 é %C3%B1 ñ %C3%9F ß
%C3%A2 â %C3%91 Ñ %C3%94 Ô
%C3%A4 ä %C2%AA ª %C3%92 Ò
%C3%A0 à %C2%BA º %C3%B5 Õ
%C3%A5 å %C2%BF ¿ %C3%95 Õ
%C3%A7 ç %C2%AC v %C2%B5 µ
%C3%AA ê %C2%BD ½ %C3%BE Þ
%C3%AB ë %C2%BC ¼ %C3%9E Þ
%C3%A8 è %C2%A1 ¡ %C3%9A Ú
%C3%AF ï %C2%AB « %C3%9B Û
%C3%AE î %C2%BB » %C3%99 Ù
%C3%AC ì %C3%81 Á %C3%BD Ý
%C3%84 Ä %C3%82 Â %C3%9D Ý
%C3%85 Å %C3%80 À %C2%B4 ´
%C3%89 É %C2%A9 © %C2%B1 ±
%C3%A6 Æ %C2%A2 ¢ %C2%BE ¾
%C3%86 Æ %C2%A5 ¥ %C2%B6 ¶
%C3%B4 Ô %C3%A3 ã %C2%A7 §
%C3%B6 Ö %C3%83 Ã %C3%B7 ÷
%C3%B2 Ò %C2%A4 ¤ %C2%B8 ¸
%C3%BB Û %C3%B0 ð %C2%B0 °
%C3%B9 Ù %C3%90 Ð %C2%A8 ¨
%C3%BF ? %C3%8A Ê %C2%B7 ?
%C3%96 Ö %C3%8B Ë %C2%B9 ¹
%C3%9C Ü %C3%88 È %C2%B3 ³
%C2%A5 ¥ %C3%8D Í %C2%B2 ²
%C2%A3 £ %C3%8E Î %C2%A6 ¦
%C6%92 ? %C5%92 ? %C2%AE ®

Perhaps someone out there has time to make a building block that performs this operation and tidies up webdav URL’s 😉

Update: Here is a c# function to do the replacing for you that you can use in .NET project


        public static string ConvertWebDavSpecialChars(string inputString)
        {
            string returnString = inputString;
            returnString = returnString.Replace("%", "%25");
            returnString = returnString.Replace(" ", "%20");
            returnString = returnString.Replace("í", "%C3%AD");
            returnString = returnString.Replace("Ì", "%C3%8C");
            returnString = returnString.Replace("Ç", "%C3%87");
            returnString = returnString.Replace("ó", "%C3%B3");
            returnString = returnString.Replace("¯", "%C2%AF");
            returnString = returnString.Replace("Ü", "%C3%BC");
            returnString = returnString.Replace("ú", "%C3%BA");
            returnString = returnString.Replace("Ó", "%C3%93");
            returnString = returnString.Replace("é", "%C3%A9");
            returnString = returnString.Replace("ñ", "%C3%B1");
            returnString = returnString.Replace("ß", "%C3%9F");
            returnString = returnString.Replace("â", "%C3%A2");
            returnString = returnString.Replace("Ñ", "%C3%91");
            returnString = returnString.Replace("Ô", "%C3%94");
            returnString = returnString.Replace("ä", "%C3%A4");
            returnString = returnString.Replace("ª", "%C2%AA");
            returnString = returnString.Replace("Ã’", "%C3%92");
            returnString = returnString.Replace("à", "%C3%A0");
            returnString = returnString.Replace("º", "%C2%BA");
            returnString = returnString.Replace("Õ", "%C3%B5");
            returnString = returnString.Replace("Ã¥", "%C3%A5");
            returnString = returnString.Replace("¿", "%C2%BF");
            returnString = returnString.Replace("Õ", "%C3%95");
            returnString = returnString.Replace("ç", "%C3%A7");
            returnString = returnString.Replace("µ", "%C2%B5");
            returnString = returnString.Replace("ê", "%C3%AA");
            returnString = returnString.Replace("½", "%C2%BD");
            returnString = returnString.Replace("Þ", "%C3%BE");
            returnString = returnString.Replace("ë", "%C3%AB");
            returnString = returnString.Replace("¼", "%C2%BC");
            returnString = returnString.Replace("Þ", "%C3%9E");
            returnString = returnString.Replace("è", "%C3%A8");
            returnString = returnString.Replace("¡", "%C2%A1");
            returnString = returnString.Replace("Ú", "%C3%9A");
            returnString = returnString.Replace("ï", "%C3%AF");
            returnString = returnString.Replace("«", "%C2%AB");
            returnString = returnString.Replace("Û", "%C3%9B");
            returnString = returnString.Replace("î", "%C3%AE");
            returnString = returnString.Replace("»", "%C2%BB");
            returnString = returnString.Replace("Ù", "%C3%99");
            return returnString;
        }

8 thoughts on “Special characters within Tridion webdav URL’s

  1. When working with for instance Components you can right click it, selecte Open with webdav and copy and past the Webdav URL from the browser address bar.

    Doesn’t work for all item types, but it saves some typo’s.

  2. Maybe something went wrong when I submitted this comment the first time…

    There is a customization framework (Created by Ryan O’Dell, supported by SDL Tridion), which provides a right-menu extension ‘Copy webdav path’. It works like a charm. No more typo’s. Of course, this table is useful when you don’t have that extension… 😀

  3. Hi Albert,

    Thanks for the message, I’ve not actually had a play with the customisation framework, but it sounds like a great inclusion. I shall get it installed and have a play.

    Regards,

  4. Pingback: SDL Tridion naming rules for items and WebDav | Tridion Developer

  5. Can you plesae explain how to get the list of componets from a webdav url in c# .NET.

    Early response will be appreciated.

    Thanks in advance.

  6. Great post! This came in handy for an Alchemy plugin I’m working on.

    Just a couple comments:
    1) I think the casing is wrong for some of the characters you listed, and the set is incomplete. However, this is generally the same set as the normal URL encodings, so you should be able to use something like WebUtility.UrlEncode().
    2) Tridion handles some characters differently, such as /, \, % and space. Below is some code I wrote that converts a path from Tridion to a webdav URL, keeping in mind these special characters:

    public static Dictionary pathToWebdavDict = new Dictionary{{ ‘%’, “%25″ }, { ‘/’, “%2F” }, { ‘\\’, “/” }, { ‘ ‘, “%20″ }};

    public static string ConvertPathToWebdav(string path)
    {
    char[] chars = path.ToCharArray();
    StringBuilder webdavStringBuilder = new StringBuilder();
    webdavStringBuilder.Append(“/webdav”);
    foreach (char c in chars)
    {
    if(pathToWebdavDict.ContainsKey(c))
    webdavStringBuilder.Append(pathToWebdavDict);
    else
    webdavStringBuilder.Append(WebUtility.UrlEncode(c.ToString()));
    }
    return webdavStringBuilder.ToString();
    }

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>