I haven't been able to find an example that does something similar to what I want, that is, replace:
% with %25
& with %26
/ with %2F
# with %23
" with space
\ with space
For the reference I'm using GWT with String.replaceAll, but I'm asking about Javascript since that is what it gets translated to anyway. I know about (component) URI encoding, but it's not what I'm after, I only need these characters.
Later edit: I'm looking for a way to do it in one or two regexes, right now it's done as this:
splits[i].replaceAll("%", "%25").replaceAll("&", "%26").replaceAll("/","%2F").replaceAll("#", "%23").replaceAll("\"", "").replaceAll("\\\\", " ");
but this seems ugly to me.