packageurl-ruby parses the PURL pkg:t/n#%25 as having a subpath %25 instead of %. This could possibly be documented as the expected behavior, except that if packageurl-ruby is used to parse that PURL and serialize it again, the resulting PURL is pkg:t/n#%2525. The escaping/unescaping is not symmetrical between parsing and serializing.