# HG changeset patch # User Sebastien Jodogne # Date 1504345808 -7200 # Node ID a051aba0037c54fb5e6c19d1e8511829db87252f # Parent f235cc740c4b07f8bc9eb0ed2648864fa6bc475e Use "GBK" (frequently used in China) as an alias for "GB18030" diff -r f235cc740c4b -r a051aba0037c Core/Enumerations.cpp --- 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; } /* diff -r f235cc740c4b -r a051aba0037c NEWS --- 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 diff -r f235cc740c4b -r a051aba0037c UnitTestsSources/FromDcmtkTests.cpp --- 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); }