Tag Encoding for URLS

It looks like Tag URLS go threw some sort of custom encoding. How can we emualte this in the front end, there does not seem to be any Velocity function that does the same types of encoding.

For example, Step-Up (Boost) Regulators gets encoded to Step_2D00_Up%2b_2800_Boost_2900_%2bRegulators

If this was just simple URL encoding, it would be Step-Up+%28Boost%29+Regulators however that is not the case.

Parents
  • If you're linking to the a tag page, you can generate the URL via scripting which will also handle the encoding of the tag.

    It appears that the encoding used for tags (tags, CFS files, paths) is not exposed directly to scripting. 

    For path components (like tags), the encoding replaces non-alphanumeric characters:

    • Spaces are replaced with +
    • Periods are replaced with -
    • Other non-alphanumeric characters are encoded using their unicode bytes as hex values (two hex digits per byte) surrounded with _

    This encoding is mostly historic to work around issues with IIS and lossless text encoding. 

    I've logged a bug to expose UrlEncodeFileComponent, UrlEncodePathComponent, and UrlDecodePathComponent (UrlDecodeFileComponent already exists) on $core_v2_encoding;

    TE-18410: Expose Url Encode/Decode Path/File Component to Scripting

    Completed for 13.0, 14.0, 12.1.6

Reply
  • If you're linking to the a tag page, you can generate the URL via scripting which will also handle the encoding of the tag.

    It appears that the encoding used for tags (tags, CFS files, paths) is not exposed directly to scripting. 

    For path components (like tags), the encoding replaces non-alphanumeric characters:

    • Spaces are replaced with +
    • Periods are replaced with -
    • Other non-alphanumeric characters are encoded using their unicode bytes as hex values (two hex digits per byte) surrounded with _

    This encoding is mostly historic to work around issues with IIS and lossless text encoding. 

    I've logged a bug to expose UrlEncodeFileComponent, UrlEncodePathComponent, and UrlDecodePathComponent (UrlDecodeFileComponent already exists) on $core_v2_encoding;

    TE-18410: Expose Url Encode/Decode Path/File Component to Scripting

    Completed for 13.0, 14.0, 12.1.6

Children
No Data