hurl icon indicating copy to clipboard operation
hurl copied to clipboard

Support Hurl unicode literal in multiline string

Open jcamiel opened this issue 1 year ago • 1 comments

As written in the Hurl grammar, multiline strings and one line strings should support Hurl unicode literals:

POST https://foo.com
```
Un bon caf\u{e9}!
```

equivalent to:

POST https://foo.com
```
Un bon café!
```

One line strings should be OK also:

POST https://foo.com
`Un bon caf\u{e9}!`

equivalent to

POST https://foo.com
`Un bon café!`

Multiline strings with "Langage hint" also work:

POST https://foo.com
```json
{ 
 "word" :"Un bon ca\u{e9}!"
}
```

While, in the last case, it should be more idiomatic to use a JSON body with JSON unicode literals:

POST https://foo.com
{ 
  "word" :"Un bon ca\u00e9!"
}

Note: we don't support Hurl unicode literals in JSON body as it may add confusion with JSON unicode literals \u{e9} vs \u00e9

jcamiel avatar Feb 14 '24 10:02 jcamiel

As discussed, escapes won't be interpreted in a multiline string body by default. Escaping will be triggered explicitly with the escape attribute.

 ```escape
this is a tab <\t>
```

On the contrary, variables will be evaluated by default. They will not be evaluated with the novariable attribute.

```novariable
Hello {{name}}! 
```

fabricereix avatar Jul 31 '24 13:07 fabricereix

While multiline strings supports escape and novariale attribute now, we're going to deprecate them.

jcamiel avatar Mar 01 '25 12:03 jcamiel