changeset 2401:a051aba0037c

Use "GBK" (frequently used in China) as an alias for "GB18030"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 02 Sep 2017 11:50:08 +0200
parents f235cc740c4b
children 741765ec8374
files Core/Enumerations.cpp NEWS UnitTestsSources/FromDcmtkTests.cpp
diffstat 3 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/Core/Enumerations.cpp	Fri Sep 01 21:37:19 2017 +0200
+++ b/Core/Enumerations.cpp	Sat Sep 02 11:50:08 2017 +0200
@@ -1415,8 +1415,15 @@
     {
       encoding = Encoding_Japanese;
     }
-    else if (s == "GB18030")
+    else if (s == "GB18030" || s == "GBK")
     {
+      /**
+       * According to tumashu@163.com, "In China, many dicom file's
+       * 0008,0005 tag is set as "GBK", instead of "GB18030", GBK is a
+       * subset of GB18030, and which is used frequently in China,
+       * suggest support it."
+       * https://groups.google.com/d/msg/orthanc-users/WMM8LMbjpUc/02-1f_yFCgAJ
+       **/
       encoding = Encoding_Chinese;
     }
     /*
--- a/NEWS	Fri Sep 01 21:37:19 2017 +0200
+++ b/NEWS	Sat Sep 02 11:50:08 2017 +0200
@@ -2,6 +2,7 @@
 ===============================
 
 * New security-related options: "DicomAlwaysAllowEcho"
+* Use "GBK" (frequently used in China) as an alias for "GB18030"
 * Experimental support of actively maintained Civetweb to replace Mongoose 3.8
 * Fix issue 64 (OpenBSD support)
 * Fix static compilation of DCMTK 3.6.2 on Fedora
--- a/UnitTestsSources/FromDcmtkTests.cpp	Fri Sep 01 21:37:19 2017 +0200
+++ b/UnitTestsSources/FromDcmtkTests.cpp	Sat Sep 02 11:50:08 2017 +0200
@@ -263,6 +263,7 @@
   // http://dicom.nema.org/medical/dicom/current/output/html/part03.html#table_C.12-5
   ASSERT_TRUE(GetDicomEncoding(e, "ISO_IR 192"));  ASSERT_EQ(Encoding_Utf8, e);
   ASSERT_TRUE(GetDicomEncoding(e, "GB18030"));     ASSERT_EQ(Encoding_Chinese, e);
+  ASSERT_TRUE(GetDicomEncoding(e, "GBK"));         ASSERT_EQ(Encoding_Chinese, e);
 }