Can't process text from variable in c#

termi

Client
Регистрация
30.10.2012
Сообщения
67
Благодарностей
2
Баллы
8
I try to process variable with Unicode and decode it to normal text using C# module. When i'm using text like that it works perfectly

C#:
string text = "Some string that I am using but Poacher\u2019s shows unicode!";
byte[] textBytes = Encoding.Unicode.GetBytes(text);
Encoding.UTF8.GetString(Encoding.Convert(Encoding.Unicode, Encoding.UTF8, textBytes));
return text;
But when i try put this text to variable and use variable it stop working

C#:
string text = project.Variables["FeturesRewrite"].Value;
byte[] textBytes = Encoding.Unicode.GetBytes(text);
Encoding.UTF8.GetString(Encoding.Convert(Encoding.Unicode, Encoding.UTF8, textBytes));
return text;
Any one have idea why it stop working?
 

arhip1985

Client
Регистрация
31.10.2011
Сообщения
2 955
Благодарностей
781
Баллы
113
whats text in mistake? maybe mistake in name your variable - "FeturesRewrite"
 

termi

Client
Регистрация
30.10.2012
Сообщения
67
Благодарностей
2
Баллы
8
No that's not a problem variable name matches
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 770
Благодарностей
1 180
Баллы
113

termi

Client
Регистрация
30.10.2012
Сообщения
67
Благодарностей
2
Баллы
8
Thx, also if there are some other way inside zenno it will work too
 

Androsyn

Client
Регистрация
04.09.2020
Сообщения
2
Благодарностей
0
Баллы
1
Hello @termi try this
return System.Text.RegularExpressions.Regex.Unescape(project.Variables["get"].Value);

its work for me
 

termi

Client
Регистрация
30.10.2012
Сообщения
67
Благодарностей
2
Баллы
8

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)