0

I have a MFC application that has translation to several languages, and I want to use the characters:

  • em-dash (—; Windows: Alt+0151; Unicode:\u2014)

  • en-dash (–; Windows: Alt+0150; Unicode:\u2013)

For the following languages, all go well:

en_GB.rc: #pragma code_page(1252)
pt_PT.rc: #pragma code_page(1252)

but it fails for those:

ja-JP.rc: #pragma code_page(932) 
ko-KR.rc: #pragma code_page(949)
zh_CHS.rc: #pragma code_page(936)

I see strange characters. And, in situations when the string has only the dash character, is doesn't even compile in CJK languages.

Yes, I know it is possible to create strings with those characters with code like

CString s= _T("\u2014");

but that destroys the purpose of having separate resource files and it is not convenient when the dashes are inside the middle of the texts.

And, if I do something like replacing

IDS_HELLO_SHE_SAID_HOW_ARE_YOU " — Hello! — she said — How are you?"

with

IDS_HELLO_SHE_SAID_HOW_ARE_YOU " \u2014 Hello! \u2014 she said \u2014 How are you?"

I will see that \u2014 as it is (verbatim) in the interface, even in the languages that were supporting well the dash characters. So, the question is: is there a way that I can directly put em-dashes and en-dashes in the .rc files that use those Chinese, Japanese and Korean codepages?

Thanks in advance, Sérgio

sergiol
  • 4,122
  • 4
  • 47
  • 81
  • 1
    The first question is of course why would you use codepages? Can't you save everything in Unicode? – dda May 09 '13 at 10:44
  • 1
    Save the .rc files in UTF-8 and use `#pragma codepage(utf-8)`. – dda May 09 '13 at 10:51

0 Answers0