Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1135

Visual Studio Resource Editor corrupts rc files with UTF-8 encoding

$
0
0

Visual Studio 2019 and 2022 Resource Editor is able to correctly read and display .rc file in UTF-8 encoding if .rc file is saved without UTF-8 BOM.The main requirements for it, .rc file must contain valid #pragma code_page.
Example:

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEUD)LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US#pragma code_page(65001)

But if you did some changes in textual resource and saves result back to .rc file, it will be corrupted:

  • all #pragma code_page(65001) will be replaced by your default ANSI code page (e.g. #pragma code_page(1252))
  • all non ANSI symbol will be replaced by ?.

Is there some way how to work with UTF-8 c++ resource in Visual Studio 2019\2022 Resource Editor without this bug.

P.S.:

  • I don't use Unicode (UTF-16 LE) encoding due to problems in git with it.
  • Using UTF-8 without BOM is single way how to compile UTF-8 .rc file in Visual Studio, see link.

Viewing all articles
Browse latest Browse all 1135

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>