xref: /haiku/src/apps/terminal/ShellInfo.cpp (revision ed24eb5ff12640d052171c6a7feba37fab8a75d1)
1 /*
2  * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include "ShellInfo.h"
8 
9 #include <CharacterSet.h>
10 #include <CharacterSetRoster.h>
11 
12 #include "TermConst.h"
13 
14 using namespace BPrivate ; // BCharacterSet stuff
15 
16 
17 ShellInfo::ShellInfo()
18 	:
19 	fProcessID(-1),
20 	fIsDefaultShell(true),
21 	fEncoding(M_UTF8),
22 	fEncodingName("UTF-8")
23 {
24 }
25 
26 
27 void
28 ShellInfo::SetEncoding(int encoding)
29 {
30 	fEncoding = encoding;
31 
32 	const BCharacterSet* charset
33 		= BCharacterSetRoster::GetCharacterSetByConversionID(fEncoding);
34 	fEncodingName = charset ? charset->GetName() : "UTF-8";
35 }
36