When selector contains [“],cannot use variable in it

Hello,

My English is not very good ,
so If these is any word weird,I'm  sorry.
First,I want talk about the chinese double quotation mark  [“].
Usually [“] is just an Character Like a,あ,阿 And it is 2 byte,
I don't kown why but in UiPath Studio most of the time [“]  just equels ["] like this.

1

So if I want use [“] as a text ,in theory,I need to write it twice like this .

2

if I write ["“"],it will be an error in editor.

3

Then intersting thing happened that if I just click [ok],then error disappeared.

4

So actually, [“]  can be  used as a text without write twice,
but only on when write it directly as string,
if I write it in a function,it will be an error.

5

Then this is the problem,
In selector,["] will be converted to [&/quot/;],but [“] just [“].
After UiPath.UIAutomation.Activities upgrade to 21.4(or earlier but not 20.10),
When I use a variable in seletor,it will become to a String.Format funtion.
So if the selector string contains  [“] And I try to use a variable in this seletor,
error occurs.

7
6

If I write [“] twice ,error disappeared,
but uielement cannot be recognized of course.

In 20.10 or earlier ,there isn't any funtion appears in selector,so that's all right.
I know there is some way can avoid this problem,
but I hope it can be fixed.

thanks.

text.txt (1.3 KB)

Hi,

In this forum, some special characters including double quote are automatically convert to other character. For example "abc" is automatically converted to “abc”. (0x22 to \u201c and \u201d)

So can you use preformatted text (the above </> button) to show more accurate character or share your text as file?

Regards,

Thanks for your adivice,I tryed.

Hi,

How about using regex selector.

For example, selector for this page is as the following.

s = "When selector contains \[\u201c\],cannot use variable in it - Feedback / Activities - UiPath Community Forum"

Then

<html app='firefox.exe' title='{{s}}' matching:title='regex' />

Regards,

Sorry I’m using another account to reply because I’m home.
Thanks for your advice.

I know I can use char code with regex or put that part into a variable or just use wildcard to avoid this problem.
But other people like beginers ,they just do right thing and an error occurs.
So I hope official can fix this.