Re: RFE: StringTemplate interpolation with custom function

2023-10-26 Thread Jim Laskey
So you are looking for a different feature - escape sequence suppression. I think that can be simply addressed independently. 📱 > On Oct 26, 2023, at 5:25 PM, Rob Spoor wrote: > > Because if you URL encode the entire interpolated string the : and / inside > the URL will also be encoded (to

Re: RFE: StringTemplate interpolation with custom function

2023-10-26 Thread Rob Spoor
Because if you URL encode the entire interpolated string the : and / inside the URL will also be encoded (to %3A and %2F respectively). Likewise, the CSV escaping will escape all of the double quotes incorrectly. On 26/10/2023 22:05, Jim Laskey wrote: I think I’m missing something. Why wouldn

Re: RFE: StringTemplate interpolation with custom function

2023-10-26 Thread Jim Laskey
I think I’m missing something. Why wouldn’t you just; import java.lang.StringTemplate.Processor; Processor urlEncode = template -> URLEncoder.encode(template.interpolate(), UTF_8)); Processor CSV = template -> StringEscapeUtils.escapeCsv

RFE: StringTemplate interpolation with custom function

2023-10-26 Thread Rob Spoor
I've been reading up on string templates, and I think it's a very cool feature. However, writing a custom processor can be a lot of copy-paste work if you want STR but with some extra translation applied. For instance, if I'd want to have a URL encoding processor I would have to write everythin