Question: So from the textarea I take the shortcode `%91samurai id="19"%93` it should be `[samurai id="19"]`:

```
var not_decoded_content = jQuery('[data-module_type="et_pb_text_forms_00132547"]')
.find('#et_pb_et_pb_text_form_content').html();

```

But when I try to decode the `%91` and `%93` 

```
self.content = decodeURI(not_decoded_content);

```

I get the error:

> 
> Uncaught URIError: URI malformed
> 
> 
> 

How can i solve this problem?

Answer: 
The encodings are **invalid**. If you can't fix the whatever-system-produces-them to **correctly** produce %5B and %5D, then your only option is to do a replacement yourself: replace all %91 with character 91 which is '[', then replace all %93 with character 93 which is ']'.

Note that javascript String Replace as-is won't do "Replace all occurrences". If you need that, then create a loop (while it contains(...) do a replace), or search the internet for `javascript replace all`, you should find plenty results.

And a final note, I am used to using `decodeURIComponent(...)`. If you can make the whatever-system-produces-them to **correctly** produce %5B and %5D, and you still get that error, then try using `decodeURIComponent(...)` instead of `decodeURI`(...).
I know this is not the solution you want to see, but can you try using "`%E2%80%98`" for `%91` and "`%E2%80%9C`" for `%93` ?

The `%91` and `%93` are part of [control characters](https://en.wikipedia.org/wiki/ASCII#ASCII_control_characters) which html does not like to decode (for reasons beyond me). Simply put, they're not your ordinary ASCII characters for HTML to play around with.