Can't process text from variable in c#

  • Автор темы Автор темы termi
  • Дата начала Дата начала

termi

Client
Регистрация
30.10.2012
Сообщения
69
Реакции
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?
 
No that's not a problem variable name matches
 
Thx, also if there are some other way inside zenno it will work too
 
Hello @termi try this
return System.Text.RegularExpressions.Regex.Unescape(project.Variables["get"].Value);

its work for me
 

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