diff --git a/DicomTypeTranslation/DicomTypeTranslaterReader.cs b/DicomTypeTranslation/DicomTypeTranslaterReader.cs index addd9a2..ee0dad9 100644 --- a/DicomTypeTranslation/DicomTypeTranslaterReader.cs +++ b/DicomTypeTranslation/DicomTypeTranslaterReader.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Text; using FellowOakDicom; using MongoDB.Bson; @@ -332,9 +333,10 @@ private static BsonValue CreateBsonValue(DicomDataset dataset, DicomItem item, b else if (!DicomTypeTranslater.SerializeBinaryData && DicomTypeTranslater.DicomVrBlacklist.Contains(item.ValueRepresentation)) retVal = BsonNull.Value; - else if (element is DicomStringElement) + else if (element is DicomStringElement se) { - if (element is not DicomMultiStringElement && element.Length == 0) + se.TargetEncoding = Encoding.UTF8; + if (se is not DicomMultiStringElement && se.Length == 0) retVal = BsonNull.Value; else retVal = (BsonString)dataset.GetString(element.Tag); diff --git a/DicomTypeTranslation/DicomTypeTranslation.csproj b/DicomTypeTranslation/DicomTypeTranslation.csproj index 4661134..2ddf9ee 100644 --- a/DicomTypeTranslation/DicomTypeTranslation.csproj +++ b/DicomTypeTranslation/DicomTypeTranslation.csproj @@ -30,7 +30,7 @@ - +