非7bit-ASCII文字置換
- ページ: Macro/投稿
- 作者: miau?
- カテゴリー: pls
- 投稿日: 2006-07-20 (木) 09:24:11
メッセージ
選択文字列中で 7-bit ASCII 以外の部分を \x80 に置換するマクロです。
その文字列が「バイト単位の parse しかしてくれないプログラムからどう見えるか」を調べるのに便利かもしれません。
※実際は \x80 に置き換えるんですが、IE だと ? とか表示されて見にくいのでここでは中点にしています。
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
| | use strict;
use warnings;
use Win32::Clipboard;
my $is_text_selected = IsTextSelected();
exit 0 unless $is_text_selected;
my $seltext = GetSelectedString();
$seltext =~ tr/\x81-\xff/\x80/;
if ($is_text_selected == 2) {
Win32::Clipboard::Set($seltext);
PasteBox();
}
else {
InsText($seltext);
}
|