Skip to content

Commit c568c54

Browse files
committed
Merge pull request #173 from jamadam/perl-formatter-improve
Perl formatter improvement
2 parents 0cdc1b9 + 362777c commit c568c54

File tree

1 file changed

+8
-5
lines changed
  • ide/plugins/perl-format/src/content/formats

1 file changed

+8
-5
lines changed

ide/plugins/perl-format/src/content/formats/perl-rc.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,12 @@ var formatter = this;
2727
string = function(value) {
2828
if (value != null) {
2929
value = value.replace(/\\/g, '\\\\');
30-
value = value.replace(/\"/g, '\\"');
30+
value = value.replace(/\'/g, '\\\'');
3131
value = value.replace(/\r/g, '\\r');
3232
value = value.replace(/\n/g, '\\n');
33-
value = value.replace(/@/g, '\\@');
34-
value = value.replace(/\$/g, '\\$');
35-
return '"' + value + '"';
33+
return "'" + value + "'";
3634
} else {
37-
return '""';
35+
return "'";
3836
}
3937
}
4038

@@ -229,6 +227,11 @@ this.options = {
229227
header:
230228
'use strict;\n' +
231229
'use warnings;\n' +
230+
'use utf8;\n' +
231+
'BEGIN {\n' +
232+
' binmode STDOUT, ":utf8";\n' +
233+
' binmode STDERR, ":utf8";\n' +
234+
'}\n' +
232235
'use Time::HiRes qw(sleep);\n' +
233236
'use Test::WWW::Selenium;\n' +
234237
'use Test::More "no_plan";\n' +

0 commit comments

Comments
 (0)