Special characters

Special characters - Special characters encoding - Сообщения

#1 Опубликовано: 02.06.2021 05:06:43
brice

brice

1 сообщений из 5 понравились пользователям.

Группа: User

Hi,
I trie to split string every underscore :
B_net="PM1_to_MM1_gth_vpx_p[0]"
with function :
strsplit(B_net,"_" )=mat("PM1_to_MM1_gth_vpx_p[0]",1,1)

I want to extract here "PM1" and "MM1" with
el(strsplit(B_net,"\005F\" ),1)
el(strsplit(B_net,"\005F\" ),3)


But, the underscore is seen as UTF-16 encoding :
strsplit(B_net,"\005F\" )

Thanks for your help

Regards

Bricemik


#2 Опубликовано: 02.06.2021 08:35:52
Andrey Ivashov

Andrey Ivashov

2271 сообщений из 3734 понравились пользователям.

Группа: Super Administrator

Hello. Please use the latest stable SMath Studio version.
#3 Опубликовано: 02.06.2021 11:55:13
brice

brice

1 сообщений из 5 понравились пользователям.

Группа: User

Hello,

Thank you for your quick feedback
I would like to take this opportunity to thank you for your tool that I use for a few years ago.


Concerning the trouble, I use the lasted stable Smath Studio version : 0.99 build 7822

I import string from a csv file.
The strplit don't recognize the underscore.
However, the findstr does

If I use the strrep function to replace the underscore by the underscore in the string, the strplit recognize the underscore.

Please see below the extract :

text=mat("MM1_To_PM1_presence",1,1)
b_net:el(text,1)="MM1_To_PM1_presence"
strsplit(b_net,"\005F\" )=mat("MM1_To_PM1_presence",1,1)
findstr(b_net,"\005F\" )=mat(4,7,11,3,1)
b_net:strrep(b_net,"\005F\","\005F\" )="MM1\005F\To\005F\PM1\005F\presence"
strsplit(b_net,"\005F\" )=mat("MM1","To","PM1","presence",4,1)
findstr(b_net,"\005F\" )=mat(4,7,11,3,1)

I have this trouble since the lasted stable version.

With the previous stable version, 0.99 build 7610, the split function is ok :
text=mat("MM1_To_PM1_presence",1,1)
b_net:el(text,1)="MM1_To_PM1_presence"
strsplit(b_net,"_" )=mat("MM1","To","PM1","presence",4,1)
findstr(b_net,"\005F\" )=mat(4,7,11,3,1)
b_net:strrep(b_net,"\005F\","\005F\" )="MM1\005F\To\005F\PM1\005F\presence"
strsplit(b_net,"\005F\" )=mat("MM1","To","PM1","presence",4,1)
findstr(b_net,"\005F\" )=mat(4,7,11,3,1)

Please to not take into consideration the space before the parenthesis.
If not, there is a smiley ").

Thanks

Bricemik









#4 Опубликовано: 02.06.2021 13:55:57
Andrey Ivashov

Andrey Ivashov

2271 сообщений из 3734 понравились пользователям.

Группа: Super Administrator

Please could you attach your worksheet? I cannot reproduce this issue.
#5 Опубликовано: 02.06.2021 15:33:26
brice

brice

1 сообщений из 5 понравились пользователям.

Группа: User

Please find attached the files.

Regards

Файл не найден.Файл не найден.

1 пользователям понравился этот пост
Andrey Ivashov 02.06.2021 16:29:00
#6 Опубликовано: 02.06.2021 16:29:26
Andrey Ivashov

Andrey Ivashov

2271 сообщений из 3734 понравились пользователям.

Группа: Super Administrator

Thank you! Reproduced.
Will fix.
#7 Опубликовано: 02.06.2021 16:32:06
overlord

overlord

554 сообщений из 1333 понравились пользователям.

Группа: Moderator

Wrote

Thank you! Reproduced.
Will fix.


Maybe windows release has this issue.
Linux load and split it correctly.

Regards

2021-06-02_22-31.png
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений