encodeURIComponent() is actually used on line 10 to encode all other special characters. I chose to custom encode slashes because Apache refuses to accept the default encoded %2F (which encodeURIComponent() turns slashes into).