Replace All accented letters from a listview selection


#1

I need help to replace all accented letters when I click in a list item.
I was able to replace one accented letter and worked fine, but I need to replace more letters in another phrase when list item is selected.
For example - I successfully replaced ê by e. BUT sometimes I have a phrase with ç and ã. So I would like to replace ç to c and ã to a and other letters if necessary.
image
image

Is it possible to create a procedure for more options? Or there is another way?


#2

You can try Web.UrlEncode if that suits your backend script. Alternatively you could create a list of pairs where each pair contains the raw character and the one you want to replace it with. Because your list could get very long, I recommend creating a JSON list

{
  "ê": "e",
  "ç": "c",
  "ã": "a",
...
}

With Web.JSONDecode you can convert that into a list of pairs. You would then have to iterate over each pair and do a replace key with value.

TL;DR The safer way is option one


#3

Thanks.
Option one: That changed the URL, but didn’t work well. The url link now doesn’t go anywhere.
Am I missing any block?
image

Option two: don’t know how to do it.


#4

Option one: You must only url encode your input text. I assume that is ColinTreeListViewElement1.Text in your case. same with the replace


#5

Yes. YES.
I tried that too. And it converted correctly.
http://xxx.php?valueToSearch=gêmeos+sentado&search=Filtrar
But when it is trying to really connects to the url. the url knows that sign and corvert back to ê.


I think I would need option two to convert it using json list( With Web.JSONDecode). But how should I do that?


#6

SOLVED!!! I created a procedure like this:
image

and worked!.

Thanks