Results 1 to 7 of 7

Thread: Does Visual Studio 6.0 support UTF-8 encoding? Can I set other codepages for export?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2019
    Posts
    12

    Question Does Visual Studio 6.0 support UTF-8 encoding? Can I set other codepages for export?

    Hi. I want to know if Visual Studio 6.0 (in my case Visual C++ 6.0) supports UTF-8 encoding of files (I am running Windows 98 SE in a virtual machine, VS6 is running in that machine). Because I can't seem to see any way to change default encoding of the source code. I need UTF-8 so GitHub doesn't complain about different encoding used for files (and Czech characters are incorrectly displayed when using that encoding on GitHub).

    Next question: How can I change an export codepage to other values - like DOS encoding? Because ANSI encoding is good for Windows applications, but console applications need DOS encoding in order to display special characters correctly. I need to display correct codepages. Because I am using Czech characters in my applications, I need codepages 1250 (Czech ANSI) and 852 (Czech DOS). I know how to set codepage 1250, it is in the list. But how do I set the codepage 852?

  2. #2
    Fanatic Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    996

    Re: Does Visual Studio 6.0 support UTF-8 encoding? Can I set other codepages for expo

    If codepage 852 isn't installed, then you need to first install it. Have a look at http://www.barrcentral.com/help/beps...to_Windows.htm which describes how to install a missing code page.

    Once installed, it should appear on the list.
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2019
    Posts
    12

    Re: Does Visual Studio 6.0 support UTF-8 encoding? Can I set other codepages for expo

    Well, 852 is installed, for sure. It's Windows 98 SE, which works on MS-DOS architecture, CP852 is installed and used for MS-DOS command prompt, while CP1250 is used for Windows. Console application needs CP852 since it runs under MS-DOS command prompt, even it's actually Win32 application.

  4. #4
    Fanatic Member 2kaud's Avatar
    Join Date
    May 2014
    Location
    England
    Posts
    996

    Re: Does Visual Studio 6.0 support UTF-8 encoding? Can I set other codepages for expo

    If it's installed then you just need to select and use it. See SetConsoleCP() https://docs.microsoft.com/en-us/win...e/setconsolecp
    All advice is offered in good faith only. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2019
    Posts
    12

    Re: Does Visual Studio 6.0 support UTF-8 encoding? Can I set other codepages for expo

    You know what? Forget export, because I guess you misunderstood. I need to correctly display Czech characters in compiled programs, but I'd like to avoid Unicode, because Windows 98 does not naturally support Unicode encoding (it can be, however, installed). For Windows apps, I need ANSI, which I can use. But console app needs MS-DOS encoding (CP852) because not only I need to correctly display output, I also need to correctly intercept input.

    But that's nothing. What bothers me more is the way to save source code into UTF-8 encoding. GitHub complains about it saved in ANSI encoding and it can't correctly display Czech characters that I wrote inside (my name for instance). So I look for a way to save the source code from VS6 to UTF-8 (and VS6 to actually correctly open UTF-8 file), so GitHub does not complain and it can display correct characters.

  6. #6
    Frenzied Member
    Join Date
    May 2014
    Location
    Kallithea Attikis, Greece
    Posts
    1,289

    Re: Does Visual Studio 6.0 support UTF-8 encoding? Can I set other codepages for expo

    You can use M2000 environment: https://github.com/M2000Interpreter/Environment
    This is the setup file:
    https://github.com/M2000Interpreter/...00language.exe

    Has an Interpreter to do automatic tasks.

    Dir c:\aName

    Document Utf8Doc$
    Load.Doc Utf8Doc$, "import_file", 1029 ' Czech locale
    \\ change line feed to 10 for ubuntu, or 0 (crlf) for Windows
    With Utf8Doc$, "ListLoadedType", 10 ' for lf (character 10) only
    \\ BOM is the two byte marker
    Save.Doc Utf8Doc$, "export_file", -2 ' utf8 -2 without BOM or 2 with BOM
    Last edited by georgekar; Sep 23rd, 2020 at 05:44 AM.

  7. #7

    Thread Starter
    New Member
    Join Date
    Jul 2019
    Posts
    12

    Re: Does Visual Studio 6.0 support UTF-8 encoding? Can I set other codepages for expo

    Quote Originally Posted by georgekar View Post
    You can use M2000 environment: https://github.com/M2000Interpreter/Environment
    This is the setup file:
    https://github.com/M2000Interpreter/...00language.exe

    Has an Interpreter to do automatic tasks.

    Dir c:\aName

    Document Utf8Doc$
    Load.Doc Utf8Doc$, "import_file", 1029 ' Czech locale
    \\ change line feed to 10 for ubuntu, or 0 (crlf) for Windows
    With Utf8Doc$, "ListLoadedType", 10 ' for lf (character 10) only
    \\ BOM is the two byte marker
    Save.Doc Utf8Doc$, "export_file", -2 ' utf8 -2 without BOM or 2 with BOM
    Frankly I didn't even hope last time that someone will return to this rather old thread and reply Thank you, it seems like pretty reasonable thing to do I'll save it up for later as I am rather busy doing other stuff, more important - notably studying, and I also run a Minecraft server with a friend of mine, so other projects are kind of on hold until we open our server to public (I guess it will happen sooner than I'll finish school or at least academic year). But very much thank you and I think I can lock this thread down and if I need another help, I'll simply make a new one

    It is a little bit of a dirty solution to me, but if it works, I ain't throw it away, you know?

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width