# Encode/Decode text are not equal

**URL:** https://community.glideapps.com/t/encode-decode-text-are-not-equal/70357
**Category:** Ask for Help
**Created:** [February 1, 2024, 9:35am UTC](https://community.glideapps.com/t/encode-decode-text-are-not-equal/70357 "2024-02-01T09:35:12Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Luca\_Dipa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_dipa/32/67530_2.png) [@Luca\_Dipa](https://community.glideapps.com/u/Luca_Dipa)
#### Post date: [February 1, 2024, 9:35am UTC](https://community.glideapps.com/t/encode-decode-text-are-not-equal/70357/1 "2024-02-01T09:35:12Z")

</div>

Hi guys!

I have an issue with encode/decode functions. For example I have this code to decode and then encode:

Decode this url with plugin:  
%27horizontal%27%2C%20%5B%27%230e5dc2%27%2C%20%27%23041b38%27%5D

**The result is:** ‘horizontal’, [‘#0e5dc2’, ‘#041b38’]

This works fine! But if I encode the result with plugin/encode column the result is:

‘horizontal’%2C%20%5B’%230e5dc2’%2C%20’%23041b38’%5D

So, why I have a different result? I could use another function to have the first result? 😅

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [February 1, 2024, 1:46pm UTC](https://community.glideapps.com/t/encode-decode-text-are-not-equal/70357/2 "2024-02-01T13:46:38Z")

</div>

Looks like it’s not encoding the single quotes. Maybe it doesn’t because it’s probably using `encodeURIComponent` which I’m finding does not encode certain characters because they don’t need to be.

Is it causing issues down the line? If so, you could run the encoded result through a template column to replace the single quotes with `%27`.

You could also try this with a javascript column if you want to encode it with just one column.

`return encodeURIComponent(p1).replace(/[!'()*]/g, escape);`

---

<div class="post-metadata">

### Author: ![Luca\_Dipa](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/luca_dipa/32/67530_2.png) [@Luca\_Dipa](https://community.glideapps.com/u/Luca_Dipa)
#### Post date: [February 1, 2024, 3:05pm UTC](https://community.glideapps.com/t/encode-decode-text-are-not-equal/70357/3 "2024-02-01T15:05:50Z")

</div>

Thanks Jeff 🙂

Yes it’s causing an issue, so I wil use the js column that you write me !

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)
#### Post date: [February 8, 2024, 3:06pm UTC](https://community.glideapps.com/t/encode-decode-text-are-not-equal/70357/4 "2024-02-08T15:06:29Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
