I am creating components and folders with the core service, but when trying to read back the components via WebDav paths i am noticing some characters need to be encoded, while others don't (e.g. "?" does not require encoding, but "." needs to be encoded as %2E ) I want to future proof this, is there a definitive list of characters that need to be encoded when reading WedDav paths?
[TestCase(@"/webdav/03C Content Master/Building Blocks/Content/Test Content/PathTests")]//Passes
[TestCase(@"/webdav/03C Content Master/Building Blocks/Content/Test Content/PathTests/Chinese Characters 相关 Test")]//Passes
[TestCase(@"/webdav/03C Content Master/Building Blocks/Content/Test Content/PathTests/Acute Characters É Test")]//Passes
[TestCase(@"/webdav/03C Content Master/Building Blocks/Content/Test Content/PathTests/Plus Symbol + Test")]//Passes
[TestCase(@"/webdav/03C Content Master/Building Blocks/Content/Test Content/PathTests/Question Mark ? Test")]//Passes
[TestCase(@"/webdav/03C Content Master/Building Blocks/Content/Test Content/PathTests/Forward Slash / Test")]//Fails
[TestCase(@"/webdav/03C Content Master/Building Blocks/Content/Test Content/PathTests/Percentage % Test")]//Fails
[TestCase(@"/webdav/03C Content Master/Building Blocks/Content/Test Content/PathTests/Period . Test")]//Fails
[TestCase(@"/webdav/03C Content Master/Building Blocks/Content/Test Content/PathTests/Forward Slash %2F Test")]//Passes
[TestCase(@"/webdav/03C Content Master/Building Blocks/Content/Test Content/PathTests/Percentage %25 Test")]//Passes
[TestCase(@"/webdav/03C Content Master/Building Blocks/Content/Test Content/PathTests/Period %2E Test")]//Passes
public void GetWebdavPaths_SpecialChars(string webDavPath)
{
OrganizationalItemData folder = null;
try
{
folder = _tridionConnection.CoreService.Read(webDavPath, new ReadOptions {LoadFlags = LoadFlags.Expanded}) as OrganizationalItemData;
}
catch {}
Assert.IsNotNull(folder);
}