Ticket #37510

文字操作関連マクロの2バイト文字操作中の不具合について

Date d'ouverture: 2017-09-14 13:00 Dernière mise à jour: 2023-07-24 00:58

Rapporteur:
(Anonyme)
Propriétaire:
Type:
État:
Atteints
Composant:
Jalon:
Priorité:
5 - moyen
Sévérité:
5 - moyen
Résolution:
Fixed
Fichier:
Aucun
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Détails

マクロのstrsplit 関数で、文字列を分割していますが、 全角文字を分割すると、うまく分割できない場合があります。

「あああ|いいい|ポポポポ」という文字を「|」で分割すると 「ポ」の下位バイト(7C)が「|」と一致してしまい、意図したとおりの 分割が出来ませんでした。

マクロ側の2バイト対応や、Unicode対応の予定はないでしょうか。

Ticket History (3/7 Histories)

2017-09-14 13:00 Updated by: None
  • New Ticket "文字操作関連マクロの2バイト文字操作中の不具合について" created
2019-12-23 15:13 Updated by: None
Commentaire

直っているように見えます。

ソース

xxx = 'あああ|いいい|ホホホホ'
strsplit xxx '|' 3
sendln '# xxx           =[' xxx ']'
sendln '# groupmatchstr1=[' groupmatchstr1 ']'
sendln '# groupmatchstr2=[' groupmatchstr2 ']'
sendln '# groupmatchstr3=[' groupmatchstr3 ']'
sendln '# groupmatchstr4=[' groupmatchstr4 ']'
sendln '# groupmatchstr5=[' groupmatchstr5 ']'
int2str sr result
sendln '#         result=[' sr ']'

結果

$ # xxx           =[あああ|いいい|ホホホホ]
$ # groupmatchstr1=[あああ]
$ # groupmatchstr2=[いいい]
$ # groupmatchstr3=[ホホホホ]
$ # groupmatchstr4=[]
$ # groupmatchstr5=[]
$ #         result=[3]
(Edited, 2019-12-25 12:00 Updated by: doda)
2019-12-23 15:15 Updated by: None
Commentaire

TeraTerm Version4.105です。

(匿名) への返信

直っているように見えます。
ソース
xxx = 'あああ|いいい|ホホホホ'
strsplit xxx '|' 3
sendln '# xxx =[' xxx ']'
sendln '# groupmatchstr1=[' groupmatchstr1 ']'
sendln '# groupmatchstr2=[' groupmatchstr2 ']'
sendln '# groupmatchstr3=[' groupmatchstr3 ']'
sendln '# groupmatchstr4=[' groupmatchstr4 ']'
sendln '# groupmatchstr5=[' groupmatchstr5 ']'
int2str sr result
sendln '# result=[' sr ']'

結果
$ # xxx =あああ|いいい|ホホホホ
$ # groupmatchstr1=あああ
$ # groupmatchstr2=いいい
$ # groupmatchstr3=ホホホホ
$ # groupmatchstr4=[]
$ # groupmatchstr5=[]
$ # result=3

2019-12-25 11:57 Updated by: doda
  • Details Updated
2019-12-25 13:48 Updated by: doda
  • Résolution Update from Aucun to Accepted
  • Propriétaire Update from (Aucun) to doda
  • Jalon Update from (Aucun) to Tera Term 5.0
Commentaire

(匿名) への返信

直っているように見えます。

元のチケットには誤りが有って、2バイト目が '|' なのは 'ホ' ではなくて 'ポ' ですね。(チケットの詳細は修正しました)

strsplit xxx '|' 3

strsplit で最大数を指定すると、最後(3番目)は分割が行われず残りすべてが入ります。

この二つの要因で問題が出ていないように見えてしまっています。

  • 分割対象を 'あああ|いいい|ポポポポ' にする
  • strsplit xxx '|' のように最大数を指定しない

という変更を行うと問題が残っている事が確認できると思います。

2020-07-01 00:52 Updated by: zmatsuo
Commentaire

r8682 頃からの修正で、マクロの内部文字コードは Unicode になっています。

現在はうまく動いていると思います。

2023-07-24 00:58 Updated by: zmatsuo
  • Résolution Update from Accepted to Fixed
  • État Update from Ouvert to Atteints
Commentaire

テストしたところ問題なさそうです。

クローズします。

Attachment File List

No attachments

Modifier

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Connexion