11using System ;
2+ using System . Collections . Generic ;
23using System . Collections . ObjectModel ;
34using System . IO ;
45using System . Linq ;
@@ -18,6 +19,45 @@ public class KittyRunner : InternalDefaultRunner
1819 public KittyRunner ( string ownerProtocolName ) : base ( ownerProtocolName )
1920 {
2021 base . Name = Name ;
22+ CodePages = new List < string >
23+ {
24+ "UTF-8" ,
25+ "ISO-8859-1:1998 (Latin-1, West Europe)" ,
26+ "ISO-8859-2:1999 (Latin-2, East Europe)" ,
27+ "ISO-8859-3:1999 (Latin-3, South Europe)" ,
28+ "ISO-8859-4:1998 (Latin-4, North Europe)" ,
29+ "ISO-8859-5:1999 (Latin/Cyrillic)" ,
30+ "ISO-8859-6:1999 (Latin/Arabic)" ,
31+ "ISO-8859-7:1987 (Latin/Greek)" ,
32+ "ISO-8859-8:1999 (Latin/Hebrew)" ,
33+ "ISO-8859-9:1999 (Latin-5, Turkish)" ,
34+ "ISO-8859-10:1998 (Latin-6, Nordic)" ,
35+ "ISO-8859-11:2001 (Latin/Thai)" ,
36+ "ISO-8859-13:1998 (Latin-7, Baltic)" ,
37+ "ISO-8859-14:1998 (Latin-8, Celtic)" ,
38+ "ISO-8859-15:1999 (Latin-9, \" euro\" )" ,
39+ "ISO-8859-16:2001 (Latin-10, Balkan)" ,
40+ "KOI8-U" ,
41+ "KOI8-R" ,
42+ "HP-ROMAN8" ,
43+ "VSCII" ,
44+ "DEC-MCS" ,
45+ "Win1250 (Central European)" ,
46+ "Win1251 (Cyrillic)" ,
47+ "Win1252 (Western)" ,
48+ "Win1253 (Greek)" ,
49+ "Win1254 (Turkish)" ,
50+ "Win1255 (Hebrew)" ,
51+ "Win1256 (Arabic)" ,
52+ "Win1257 (Baltic)" ,
53+ "Win1258 (Vietnamese)" ,
54+ "CP437" ,
55+ "CP620 (Mazovia)" ,
56+ "CP819" ,
57+ "CP852" ,
58+ "CP878" ,
59+ "Use font encoding" ,
60+ } ;
2161 }
2262
2363 private int _puttyFontSize = 14 ;
@@ -42,7 +82,29 @@ public string PuttyThemeName
4282 [ JsonIgnore ]
4383 public ObservableCollection < string > PuttyThemeNames => new ObservableCollection < string > ( PuttyThemes . Themes . Keys ) ;
4484
85+ [ JsonIgnore ]
86+ public List < string > CodePages { get ; }
4587
88+ private string _lineCodePage = "UTF-8" ;
89+ public string LineCodePage
90+ {
91+ get => _lineCodePage ;
92+ set => SetAndNotifyIfChanged ( ref _lineCodePage , value ) ;
93+ }
94+
95+ public string GetLineCodePageForIni ( )
96+ {
97+ // { "UTF-8", "UTF-8" },
98+ // { "ISO-8859-1:1998 (Latin-1, West Europe)", "ISO-8859-1%3A1998%20(Latin-1,%20West%20Europe)" },
99+ // { "ISO-8859-5:1999 (Latin/Cyrillic)", "ISO-8859-5%3A1999%20(Latin%2FCyrillic)" },
100+ // { "ISO-8859-15:1999 (Latin-9, \"euro\")", "ISO-8859-15%3A1999%20(Latin-9,%20%22euro%22)" },
101+ // { "CP437", "CP437" },
102+ return _lineCodePage . Trim ( )
103+ . Replace ( " " , "%20" )
104+ . Replace ( "\" " , "%22" )
105+ . Replace ( "/" , "%2F" )
106+ . Replace ( ":" , "%3A" ) ;
107+ }
46108
47109 private string _puttyExePath = "" ;
48110 public string PuttyExePath
0 commit comments