Mercurial > hg > orthanc
comparison Core/Toolbox.cpp @ 1090:e494ceb8d763
support more encodings
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 05 Aug 2014 12:04:23 +0200 |
parents | e07b90fb00eb |
children | e5686a703c63 |
comparison
equal
deleted
inserted
replaced
1089:5ea0b56e850d | 1090:e494ceb8d763 |
---|---|
530 std::string Toolbox::ConvertToUtf8(const std::string& source, | 530 std::string Toolbox::ConvertToUtf8(const std::string& source, |
531 const Encoding sourceEncoding) | 531 const Encoding sourceEncoding) |
532 { | 532 { |
533 const char* encoding; | 533 const char* encoding; |
534 | 534 |
535 | |
536 // http://bradleyross.users.sourceforge.net/docs/dicom/doc/src-html/org/dcm4che2/data/SpecificCharacterSet.html | |
535 switch (sourceEncoding) | 537 switch (sourceEncoding) |
536 { | 538 { |
537 case Encoding_Utf8: | 539 case Encoding_Utf8: |
538 // Already in UTF-8: No conversion is required | 540 // Already in UTF-8: No conversion is required |
539 return source; | 541 return source; |
573 encoding = "ISO-8859-7"; | 575 encoding = "ISO-8859-7"; |
574 break; | 576 break; |
575 | 577 |
576 case Encoding_Hebrew: | 578 case Encoding_Hebrew: |
577 encoding = "ISO-8859-8"; | 579 encoding = "ISO-8859-8"; |
580 break; | |
581 | |
582 case Encoding_Japanese: | |
583 encoding = "SHIFT-JIS"; | |
584 break; | |
585 | |
586 case Encoding_Chinese: | |
587 encoding = "GB18030"; | |
588 break; | |
589 | |
590 case Encoding_Thai: | |
591 encoding = "TIS620.2533-0"; | |
578 break; | 592 break; |
579 | 593 |
580 default: | 594 default: |
581 throw OrthancException(ErrorCode_NotImplemented); | 595 throw OrthancException(ErrorCode_NotImplemented); |
582 } | 596 } |