1 // DasherEncodingToCP.cpp
3 /////////////////////////////////////////////////////////////////////////////
5 // Copyright (c) 2002 Iain Murray, Inference Group, Cavendish, Cambridge.
7 /////////////////////////////////////////////////////////////////////////////
11 #include "DasherEncodingToCP.h"
12 #include "WinLocalisation.h"
13 using WinLocalisation::GetUserCodePage
;
15 // Track memory leaks on Windows to the line that new'd the memory
18 #define DEBUG_NEW new( _NORMAL_BLOCK, THIS_FILE, __LINE__ )
21 static char THIS_FILE
[] = __FILE__
;
25 UINT
EncodingToCP(Dasher::Opts::AlphabetTypes Encoding
) {
26 using namespace Dasher
;
33 case UTF8: // Just return Unicode Codepages
44 CodePage
= GetUserCodePage();
46 case Arabic
: // The rest need checking. Return
47 CodePage
= 1256; // user codepage if not installed.
55 case ChineseSimplified
:
58 case ChineseTraditional
:
89 CodePage
= GetUserCodePage();
93 if(!IsValidCodePage(CodePage
))
94 CodePage
= GetUserCodePage();