| 1082 | } |
| 1083 | |
| 1084 | wxCSConv* ConnectDatasourceDlg::GetEncoding() { |
| 1085 | if (m_encodings && m_encodings->IsShown()) { |
| 1086 | wxFontEncoding encoding_type = wxFONTENCODING_SYSTEM; |
| 1087 | int sel = m_encodings->GetSelection(); |
| 1088 | wxString encode_str = m_encodings->GetString(sel); |
| 1089 | |
| 1090 | if (sel == 0) return NULL; |
| 1091 | |
| 1092 | // encode_str = wxString(encode_str.wc_str(), wxCSConv(wxFONTENCODING_DEFAULT)); |
| 1093 | if (sel == 1) { |
| 1094 | encoding_type = wxFONTENCODING_UTF8; |
| 1095 | } else if (sel == 2) { |
| 1096 | encoding_type = wxFONTENCODING_UTF16LE; |
| 1097 | |
| 1098 | } else if (sel == 3) { |
| 1099 | encoding_type = wxFONTENCODING_CP1256; |
| 1100 | |
| 1101 | } else if (sel == 4) { |
| 1102 | encoding_type = wxFONTENCODING_ISO8859_2; |
| 1103 | |
| 1104 | } else if (sel == 5) { |
| 1105 | encoding_type = wxFONTENCODING_CP1250; |
| 1106 | |
| 1107 | } else if (sel == 6) { |
| 1108 | encoding_type = wxFONTENCODING_CP852; |
| 1109 | |
| 1110 | } else if (sel == 7) { |
| 1111 | encoding_type = wxFONTENCODING_GB2312; |
| 1112 | |
| 1113 | } else if (sel == 8) { |
| 1114 | encoding_type = wxFONTENCODING_BIG5; |
| 1115 | |
| 1116 | } else if (sel == 9) { |
| 1117 | encoding_type = wxFONTENCODING_ISO8859_5; |
| 1118 | |
| 1119 | } else if (sel == 10) { |
| 1120 | encoding_type = wxFONTENCODING_KOI8; |
| 1121 | |
| 1122 | } else if (sel == 11) { |
| 1123 | encoding_type = wxFONTENCODING_CP1251; |
| 1124 | |
| 1125 | } else if (sel == 12) { |
| 1126 | encoding_type = wxFONTENCODING_CP866; |
| 1127 | |
| 1128 | } else if (sel == 13) { |
| 1129 | encoding_type = wxFONTENCODING_ISO8859_7; |
| 1130 | |
| 1131 | } else if (sel == 14) { |
| 1132 | encoding_type = wxFONTENCODING_ISO8859_8; |
| 1133 | |
| 1134 | } else if (sel == 15) { |
| 1135 | encoding_type = wxFONTENCODING_CP1255; |
| 1136 | |
| 1137 | } else if (sel == 16) { |
| 1138 | encoding_type = wxFONTENCODING_SHIFT_JIS; |
| 1139 | } else if (sel == 17) { |
| 1140 | encoding_type = wxFONTENCODING_EUC_JP; |
| 1141 | } else if (sel == 18) { |
no test coverage detected