SAP Knowledge Base Article - Public

1381498 - UTF-8 languages like: Chinese, Korean, Japanese, Greek, German, or Arabic characters show as question marks when exporting a report to Text from Crystal Reports or Crystal Reports for Visual Studio

Symptom

  • Incorrect characters.
  • Report exported to text shows question marks.
  • When exporting a report to Tab Separated Text, or Text format, some text shows strange and incorrect characters.
  • Report exported to text format from Crystal Reports shows characters as question marks for languages like Chinese, Korean, Japanese, Greek, Arabic,...
  • Exporting from an application using Crystal Reports for Visual studio always exports in ANSI encoding.

Environment

  • SAP Crystal Reports 2008
  • SAP Crystal Reports 2011
  • SAP Crystal Reports 2013
  • SAP Crystal Reports 2016
  • SAP Crystal Reports 2020
  • SAP Crystal Report, Developer for Visual Studio

Reproducing the Issue

  1. In Crystal Reports, create a report off any data source.
  2. Insert Database Fields on the report that contains Chinese, Korean or Japanese characters.
  3. Export the report to Text Format.
  4. When opening the exported report in a Text Editor, notice that some of the characters shows as question marks. ( ??? )
  5. After opening the exported text file in Notepad and then saving it, the default is ANSI. When saving, change the Encoding option to UTF-8 and then open that file and it now shows it is encoded as UTF-8

Cause

  • The driver exporting a report to Text Formats uses CP_ACP (ANSI code page) to convert the Unicode string to ANSI string, therefore, unicode characters for languages like Chinese, Korean, Japanese, Greek, or Arabic, or any language requiring UTF-8 encoding will not show correctly.

Resolution

  • To export a report to Text (TXT), or Tab Separated Text (TTX) that contains characters in languages like: Chinese, Korean, Japanese, Greek, or Arabic, use UTF8 encoding, instead of ANSI. To export the characters in UTF8, add the registry key: UseUTF8Encoding, and set the value to: 1
          
                 
    WARNING The following resolution involves editing the Microsoft Registry. Using the MS Registry Editor incorrectly can cause serious problems. Use the MS Registry Editor at your own risk. For more information see the SAP Knowledge Base Article 1323322  
              
          
    1. If you are using Crystal Reports 2008, ensure you are using Service Pack 3 or above. ( The registry key was added from that version )
           
    2. Close Crystal Reports designer.
        
    3. Open the Microsoft Registry Editor. ( regedit )
        
    4. In the Microsoft Registry Editor, navigate to the path corresponding to the version of Crystal Reports used:
            
      • For Crystal Reports 2008:
         
        • For 32bit version of MS Windows:
          • HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 12.0\Crystal Reports\Export\Text
              
        • For 64bit version of MS Windows:
          • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Business Objects\Suite 12.0\Crystal Reports\Export\Text
                 
                
      • For Crystal Reports 2011, 2013, 2016, 2020:
             
        • For 32bit version of MS Windows:
          • HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Export\Text
                
        • For 64bit version of MS Windows:
          • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\Export\Text
          •  
      • For Crystal Reports Developer, for Microsoft Visual Studio:
             
          • For both 32 and 64 bit Windows and Application
            • HKEY_CURRENT_USER\SOFTWARE\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Crystal Reports\Export\Text
                  
            •     
        • Note: If the last part of the path does not exist, simply add the missing keys.
           
            
      • Under Text, add the DWORD Value: UseUTF8Encoding, and set the value to: 1
        1. 5.1 Right click on the Text key, and select "New - DWORD Value"
        2. 5.2 Set the DWORD Value to: UseUTF8Encoding
        3. 5.3 Set the value to: 1  

    Notes:
    - If the value is "0" or if it doesn't exist, which is by default, it will export in ANSI format.
    - If the value is set to "1", the exported file will be encoded using UTF-8 and have the UTF-8 BOM at the beginning.

    Keywords

    Crystal report, Exporting, txt, text. CR, cr for vs, utf-8 , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

    Product

    Crystal Reports 2008 V1 ; SAP Crystal Reports 2011 ; SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports 2020 ; SAP Crystal Reports, developer version for Microsoft Visual Studio