Ticket #37510

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

오픈 날짜: 2017-09-14 13:00 마지막 업데이트: 2023-07-24 00:58

Reporter:
(Anonymous)
소유자:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
None
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Details

マクロの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
댓글 올리기

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

ソース

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
댓글 올리기

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
  • Resolution Update from None to Accepted
  • 소유자 Update from (None) to doda
  • Milestone Update from (None) to Tera Term 5.0
댓글 올리기

(匿名) への返信

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

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

strsplit xxx '|' 3

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

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

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

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

2020-07-01 00:52 Updated by: zmatsuo
댓글 올리기

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

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

2023-07-24 00:58 Updated by: zmatsuo
  • Resolution Update from Accepted to Fixed
  • Status Update from Open to Closed
댓글 올리기

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

クローズします。

Attachment File List

No attachments

Edit

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