gcc -fexec-charset does not work?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: gcc -fexec-charset does not work?

  1. #1
    Join Date
    Apr 2017
    Posts
    8

    gcc -fexec-charset does not work?

    I have tried to compile file:
    ts3:~/testlibs/case_test$ g++ -g -std=c++11 -fexec-charset="cp1250" testaca.cpp -o mytest
    testaca.cpp: In function ‘int main()’:

    testaca.cpp:96:19: error: converting to execution character set: Invalid or incomplete multibyte or wide character
    string sdTest1 = "SS▒▒GS";

    File testaca us created by notepad++ or by iconv into cp1250 format ...

    "-fexec-charset=charset
    Set the execution character set, used for string and character constants. The default is UTF-8. charset can be any encoding supported by the system’s iconv library routine. " is in manual.

    So this string should be understand as cp1250 string, but it is not or I am missing something?

    The other two should not have anything to do with the problem above?
    I mean -fwide-exec-charset=charset
    -finput-charset=charset?

    ts3:~/testlibs/case_test$ file testaca.cpp
    testaca.cpp: C source, Non-ISO extended-ASCII text, with CRLF line terminators

    I could see it by cat command on Linux as "string sdTest1 = "SSŠĐGS";"
    Last edited by Pancevo1956; September 8th, 2017 at 08:45 AM.

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    18,998

    Re: gcc -fexec-charset does not work?

    Did you try to save your files as ANSI or Unicode instead?
    Victor Nijegorodov

  3. #3
    Join Date
    Apr 2017
    Posts
    8

    Re: gcc -fexec-charset does not work?

    Quote Originally Posted by VictorN View Post
    Did you try to save your files as ANSI or Unicode instead?
    I could not save as ansi, because I have non ISO characters... So I have two options CP1250 or utf-8 from notepad++. I save it in utf-8 without bom in this case.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This a Codeguru.com survey!


On-Demand Webinars (sponsored)