Login/Register
  • Home
  • Community
  • Knowledge
  • Technical Docs
  • RWS Support Policy
  • Trados Studio Licensing Help
  • Login for Support
Back to Search Results

Error when saving target file in Trados Studio: Failed to save target content: '', hexadecimal value 0x1E, is an invalid character. Line X, position Y.

000001913 |11/29/2024 11:09 AM
Scope/Environment
Trados Studio
Symptoms/Context
This issue may occur for different file types. When trying to save a target file, for example using File > Save Target As, one of the following error messages is displayed and the target file is not saved:

Failed to save target content: '', hexadecimal value 0x1E, is an invalid character. Line 1, position X.

' ', hexadecimal value 0x02, is an invalid character. Line X, position Y

Value cannot be null. Parameter name: input


The latter error with the following or similar error details:
<Exception>
    <Type>System.ArgumentNullException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</Type>
    <ParamName>input</ParamName>
    <HelpLink />
    <Source>System</Source>
    <HResult>-2147467261</HResult>
    <StackTrace><![CDATA[   at System.Text.RegularExpressions.Regex.Replace(String input, String replacement)
   at Sdl.FileTypeSupport.Framework.Core.Utilities.BilingualApi.InvalidEncodingRemovalVisitor.VisitCommentMarker(ICommentMarker commentMarker)
   at Sdl.FileTypeSupport.Framework.Bilingual.CommentMarker.AcceptVisitor(IMarkupDataVisitor visitor)
   at Sdl.FileTypeSupport.Framework.Core.Utilities.BilingualApi.InvalidEncodingRemovalVisitor.VisitChildren(IAbstractMarkupDataContainer container)
   at Sdl.FileTypeSupport.Framework.Core.Utilities.BilingualApi.InvalidEncodingRemovalVisitor.VisitSegment(ISegment segment)
   at Sdl.FileTypeSupport.Framework.Bilingual.Segment.AcceptVisitor(IMarkupDataVisitor visitor)
   at Sdl.FileTypeSupport.Framework.Core.Utilities.BilingualApi.InvalidEncodingRemovalVisitor.VisitChildren(IAbstractMarkupDataContainer container)
   at Sdl.FileTypeSupport.Framework.Core.Utilities.BilingualApi.InvalidEncodingRemovalVisitor.VisitTagPair(ITagPair tagPair)
   at Sdl.FileTypeSupport.Framework.Bilingual.TagPair.AcceptVisitor(IMarkupDataVisitor visitor)
   at Sdl.FileTypeSupport.Framework.Core.Utilities.BilingualApi.InvalidEncodingRemovalVisitor.VisitChildren(IAbstractMarkupDataContainer container)
   at Sdl.FileTypeSupport.Framework.Core.Utilities.BilingualApi.InvalidEncodingRemovalVisitor.ProcessParagraphUnit(IParagraphUnit pu)
   at Sdl.FileTypeSupport.Framework.Integration.FileExtractor.ProcessParagraphUnit(IParagraphUnit paragraphUnit)
   at Sdl.FileTypeSupport.Bilingual.Tmfc.TmfcReaderImpl.vv_Visit(TmfcReaderImpl* , FrameworkParagraphContainerField* field)
   at FrameworkParagraphContainerField.vv_AcceptFrameworkVisitor(FrameworkParagraphContainerField* , FrameworkFieldVisitor* visitor)
   at Sdl.FileTypeSupport.Bilingual.Tmfc.TmfcReaderImpl.vv_VisitStartEndField(TmfcReaderImpl* , StartEndField* startEnd)
   at Sdl.FileTypeSupport.Bilingual.Tmfc.TmfcReaderImpl.b_VisitNext(TmfcReaderImpl* )
   at Sdl.FileTypeSupport.Bilingual.Tmfc.TmfcReader.ParseNext()
   at Sdl.FileTypeSupport.Framework.Integration.FileExtractor.ParseNext()
   at Sdl.FileTypeSupport.Framework.Integration.MultiFileConverter.ParseNext()
   at Sdl.FileTypeSupport.Framework.Integration.MultiFileConverter.Parse()
   at Sdl.TranslationStudio.Editor.TranslationEditor.TranslatableDocument.SaveBilingualImpl(String[] bilingualFilePaths, Boolean copy, IJobExecutionContext context, Boolean isAutoSaved)
   at Sdl.TranslationStudio.Editor.TranslationEditor.TranslatableDocument.Save(IJobExecutionContext context)
   at Sdl.TranslationStudio.Api.Editor.SaveJobRequest.Execute(IJobExecutionContext context)
   at Sdl.Desktop.Platform.Implementation.Services.JobExecuter.Execute(JobData jobData)
   at Sdl.Desktop.Platform.Implementation.ResourceLoggingInternalCommandExecuter`1.ExecuteWithResourceLogging(TCommandData commandData, String message)
   at Sdl.Desktop.Platform.Implementation.Services.Job._worker_DoWork(Object sender, DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
   at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)]]></StackTrace>
  </Exception>

 
Resolution

 
  Remove character entity reference from sdlxliff file

  1. Close Trados Studio.
  2. Create a backup of the  *.sdlxliff file.
  3. Open the *.sdlxliff file in a text editor e.g. Notepad++.
  4. Search for the string &#x1E;
  5. Remove it from the *.sdlxliff file and save your changes.
  6. Re-open the sdlxliff file in Trados Studio.
You should now be able to save your target file.

NOTE: the character entity references might differ. Search directly for &#x to be sure the file is cleared.

The following articles may also be relevant:

Word experienced an error trying to open the file. Try these suggestions warning error appears when opening a target Word file that was translated in Trados Studio
Invalid hexadecimal character error message when opening or saving *.sdlxliff document or projects
Root Cause
A "record separator" character (http://www.fileformat.info/info/unicode/char/001e/index.htm) has been entered in the target segment.
Note: Such control characters are not visible in Trados Studio.
Reference
Send Article Feedback
RWS Machine Translation Translation Software Language Services Content Management
All Contents Copyright © RWS.
COPYRIGHT PRIVACY POLICY COOKIE POLICY TERMS AND CONDITIONS