comparison OrthancServer/ParsedDicomFile.cpp @ 1090:e494ceb8d763

support more encodings
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 05 Aug 2014 12:04:23 +0200
parents 564e39d6df13
children a66224eec125
comparison
equal deleted inserted replaced
1089:5ea0b56e850d 1090:e494ceb8d763
1213 1213
1214 Encoding ParsedDicomFile::GetEncoding() const 1214 Encoding ParsedDicomFile::GetEncoding() const
1215 { 1215 {
1216 return pimpl_->encoding_; 1216 return pimpl_->encoding_;
1217 } 1217 }
1218
1219
1220 void ParsedDicomFile::SetEncoding(Encoding encoding)
1221 {
1222 std::string s;
1223
1224 // http://www.dabsoft.ch/dicom/3/C.12.1.1.2/
1225 switch (encoding)
1226 {
1227 case Encoding_Utf8:
1228 case Encoding_Ascii:
1229 s = "ISO_IR 192";
1230 break;
1231
1232 case Encoding_Latin1:
1233 s = "ISO_IR 100";
1234 break;
1235
1236 case Encoding_Latin2:
1237 s = "ISO_IR 101";
1238 break;
1239
1240 case Encoding_Latin3:
1241 s = "ISO_IR 109";
1242 break;
1243
1244 case Encoding_Latin4:
1245 s = "ISO_IR 110";
1246 break;
1247
1248 case Encoding_Latin5:
1249 s = "ISO_IR 148";
1250 break;
1251
1252 case Encoding_Cyrillic:
1253 s = "ISO_IR 144";
1254 break;
1255
1256 case Encoding_Arabic:
1257 s = "ISO_IR 127";
1258 break;
1259
1260 case Encoding_Greek:
1261 s = "ISO_IR 126";
1262 break;
1263
1264 case Encoding_Hebrew:
1265 s = "ISO_IR 138";
1266 break;
1267
1268 /*
1269 case Encoding_Japanese:
1270 s = "ISO_IR 13";
1271 break;
1272 */
1273
1274 case Encoding_Thai:
1275 s = "ISO_IR 166";
1276 break;
1277
1278 default:
1279 throw OrthancException(ErrorCode_ParameterOutOfRange);
1280 }
1281
1282 Replace(DICOM_TAG_SPECIFIC_CHARACTER_SET, "", DicomReplaceMode_InsertIfAbsent);
1283 }
1284
1218 } 1285 }