Salesforce

Invalid hexadecimal character error message when opening or saving *.sdlxliff document or projects

« Go Back

Information

 
Article TypeSolution Article
Scope/EnvironmentKnown Issue
Symptoms/Context

Symptom 1

In SDL Trados Studio you want to convert your translated file back to the original format. However, you get the following error message:

Failed to save target content:User-added image, hexadecimal value 0x0B, is an invalid character. Line 14, position 110.

NOTE: the values in this error message may be different. When you double click on the line in the error message to fix the problem, your cursor does not jump automatically to the correct location in your file.

Symptom 2

While opening SDL Trados Studio you receive error message:

Failed to load project 'C:\[PATH to project folder]\[project name].sdlproj'.
There is an error in XML document (XYZ,XY).
hexadecimal value 0x0B, is an invalid character. Line XYZ, XY.

Symptom 3

While opening an SDLXLIFF document you receive the error message:

Unexpected error
hexadecimal value 0x1F, is an invalid character. Line XYZ, XY.

Explanation 1: Invalid character in *.sdlxliff document/file

The error message points to an invalid XML character within the SDLXLIFF file. If you open your SDLXLIFF file in a text editor, you would find something similar to the following:

<tuv xml:lang="de-DE" >
    <seg>Test the characters.</seg>
</tuv>
<tuv xml:lang="en-US">
     <seg>Test the charaUser-added imageters</seg>
</tuv>

There are several invalid characters here that could have come from the source file and be copied to the target segment. Also, invalid characters might already be stored within a translation memory from other translations, and you applied a match in the current translation.

Further. such characters are commonly not printable and are not noticeable in an usual editor. As SDLXLIFF files are basically following the XML standards these characters are not allowed as per XML 1.0 declaration.

Explanation 2: Invalid character in *.sdlproj file

If you not already received the error while trying to save a target version, then maybe after executing a verification or at another stage. In most cases the error message is saved in the *.sdlproj file that contains information about the project settings and error messages.

The invalid character(s) is/are stated in the error message and also saved within the *.sdlproj file. Because the *.sdlproj file itself is an XML document, it therefore contains an invalid character - as described in Explanation 1.

Resolution
 

​​​1. Deleting invalid characters directly in SDLXLIFF document:

  1. Create a backup copy of the existing .sdlxliff document.
  2. Open the *.sdlxliff document in an XML Editor that includes XML validation.
  3. Run the XML validation to find the invalid characters.
  4. Delete these characters and save your changes.

2. Deleting invalid characters directly in *.sdlproj document:

  1. Create a backup copy of the existing *.sdlproj file that can be found in your project folder.
  2. Open the *.sdlproj file in an XML Editor that includes XML validation.
  3. Run the XML validation to find the invalid characters.
  4. Delete these characters and save your changes.


3. ​Deleting invalid XML characters in translation memories:

Before following the steps, download the "Batchedit source and target.zip" file attached to this article and save it on your PC.Then extract the zip file and:

  1. Open SDL Trados Studio.
  2. Go to Translation Memory View.
  3. Click File > Open > Open Translation Memory... to open the translation memory that you want to cleanse from the invalid characters.
  4. Click File > Batch Edit... to open the Batch Edit dialog.
  5. As Continuation choose Always execute all edit actions in the list for each TU.
  6. Click Load.
  7. Browse to the Invalid_characters.sdltm.batchedit and Invalid_characters _source.sdltm.batchedit files that you downloaded and open it.
  8. Click Finish to start the deletion of invalid XML characters in your translation memory.
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 SDL Trados Studio.
Reference

More information about Control Characters/Codes can be found here:

 

The following list of character codes is included in the *.sdltm.batchedit file for the search/replace:
User-added image

Note that you can still remove entries from the Action item list if you do not want to include the search and replace item to be deleted. To do this highlight the Action item in the list and press the Delete button :


User-added image
 
Attachment 2 
Attachment 3 
Attachment 4 
Attachment 5 

Powered by