News:

Download Pelles C here: http://www.pellesc.se

Main Menu

Recent posts

#41
Add-ins / Re: Export C source as HTML or...
Last post by TimoVJL - January 17, 2026, 01:21:16 PM
A small stupid C to RTF project to RichEdit.

It can help to debug some code.
#42
Add-ins / Re: Export C source as HTML or...
Last post by John Z - January 17, 2026, 10:47:20 AM
Hi Robert,

Enjoy  :)  -

Both HTML and PDF formats do support UTF-8, and PDF formats are amenable to UTF-16 and others.
HTML can support UTF-16 but it is 'strongly' discouraged in the HTML5 spec so UTF-8 is mainstream for HTML.

It seems the biggest challenge is UTF-8/16 in RTF. All UTF-8 characters must be encoded using the \un? format.

So it can work, I just did the minimum to get it 'working' again.

While typing I see an update posted. I'll look at it more it seems your focus is a console program and not a windows program?  If so somewhere I saw a full fledged console program for console unicode display - maybe I can find again ...

John Z
#43
Add-ins / Re: Export C source as HTML or...
Last post by Robert - January 17, 2026, 10:35:14 AM
Hi John Z:

Yeah, well, uh ... we've got a bit of work in front of us if we hope to deal properly with non ASCII code.

This code


#include <windows.h>
#include <stdio.h>

static int OrigCodePage;
static const char* σκατ;
static const char* δυσκατανοήτων;

int main(int argc, char* argv[])
{
    OrigCodePage = GetConsoleOutputCP();
    SetConsoleOutputCP(65001);
    σκατ = "σκατ doo, be, shoo, bop, ooh, dee, doo, sha-bam";
    δυσκατανοήτων = "δυσκατανοήτων difficult to understand";
    printf("%s%s%s\n", σκατ, " ", δυσκατανοήτων);
    _getch();
    SetConsoleOutputCP(OrigCodePage);
    return 1;
}


Exports from poide.exe IDE as HTML file:

#include <windows.h>
#include <stdio.h>

static int OrigCodePage;
static const char* УКБФ;
static const char* ДХУКБФБНПЎФЩН;

int main(int argc, char* argv[])
{
    OrigCodePage = GetConsoleOutputCP();
    SetConsoleOutputCP(65001);
    УКБФ = "УКБФ doo, be, shoo, bop, ooh, dee, doo, sha-bam";
    ДХУКБФБНПЎФЩН = "ДХУКБФБНПЎФЩН difficult to understand";
    printf("%s%s%s\n", УКБФ, " ", ДХУКБФБНПЎФЩН);
    _getch();
    SetConsoleOutputCP(OrigCodePage);
    return 1;
}


Pelles C project code in attached file Skat.zip
#44
Add-ins / Re: Export C source as HTML or...
Last post by Robert - January 17, 2026, 07:39:27 AM
Hi John Z:

Very complex, very interesting.

I have had a look at Pelles and Timo's code comparing it with yours and have some ideas.

I will continue studying this and if I can get it to spit out anything intelligible, I'll let you know.

#45
Bug reports / Re: IDE Reload. Eroteme Replac...
Last post by Robert - January 17, 2026, 12:14:48 AM
Thanks John Z.

The file, created in EditPad, is initially a No-BOM UTF-8 file with only ASCII characters.
The file then is modified in poide.exe IDE adding UTF-8 glyphs beyond U+00FF.
The file is saved.
When opened in EditPad the file is reported as Windows 1252.
When re-opened in poide.exe, the UTF-8 glyphs beyond U+00FF have been replaced with erotemes.

If a No-BOM UTF-8 file, with at least one beyond U+00FF glyph, is initially loaded into poide.exe, then the file will be saved as UTF-8 No-BOM.

I will have to remember that.

#46
Bug reports / Re: IDE Reload. Eroteme Replac...
Last post by John Z - January 16, 2026, 11:06:59 PM
Hi Robert,

This is not really a bug.  It maybe a minor inconvenience but here is the situation as I understand it.

Pelle C was originally ASCII/ANSI for all source files.
Pelle C converted to having UTF-8 the default for all source files. 

It also supports UTF-16 for source files. When you create a new source file within the IDE it is automatically UTF-8.  You will see that the source file tab also shows UTF-8 (or UTF-16).  If it shows nothing but the name the source file is at best ASCII/ANSI.  When using 'OLD' source code or creating the source code file outside of Pelle C with a plain text editor it will be ASCII/ANSI

Now the critical part is that the editor now works in UTF-8 by default always.  This allows the editor to enter UTF-8 in the source code page, but since that page is not identified as UTF-8 when reloaded it will fail to display as expected.

So the Export64 program for example does not show UTF-8 in the tab so it is still ASCII/ANSI, even though the editor can make the 'display' show the character.

Using any editor that supports UTF-8 a source file can be created or just resaved saved with the encoding set to UTF-8.

I use TextPad for example to resave Export.c to Export_UTF8.c and if you add it to the Export64 program you will see the source tab shows the encoding.  If you run your test on this file it should 'pass' reloading -

Hope this was at least a little bit clear -

John Z

The other method is to create a blank source file in the IDE then paste in the old source code. When saved it will be UTF-8



#47
Beginner questions / Re: Small C Programs to Learn ...
Last post by Vortex - January 16, 2026, 10:01:48 PM
Hi jos,

In the manual supplied with Pelles C ( \PellesC\Bin\Help\help0009.chm ) search for this : Predefined preprocessor symbols (POCC)
#48
Add-ins / Re: Export C source as HTML or...
Last post by Robert - January 16, 2026, 06:54:57 PM
Quote from: TimoVJL on January 16, 2026, 06:34:08 PMzlib 1.3.1 project with missing header file, that dependecies forgot.

zlib 1.3.1 Release Notes

Thanks Timo  8)
#49
Bug reports / IDE Reload. Eroteme Replaces U...
Last post by Robert - January 16, 2026, 06:48:39 PM

When the poide.exe IDE is shut down and restarted, the UTF-8 in this code


#include <stdio.h>

/* entry point */
int main(void)
{
  printf("Hello, world!\n");
  printf("Салом Ҷаҳон!\n");
 
  return 0;
}


is reloaded to the poide.exe IDE, with question marks replacing the UTF-8, as


#include <stdio.h>

/* entry point */
int main(void)
{
  printf("Hello, world!\n");
  printf("????? ?????!!\n");
 
  return 0;
}


Tofu
https://fonts.google.com/knowledge/glossary/tofu

Eroteme
https://en.wiktionary.org/wiki/eroteme
https://en.wikipedia.org/wiki/Question_mark
#50
Add-ins / Re: Export C source as HTML or...
Last post by TimoVJL - January 16, 2026, 06:34:08 PM
zlib 1.3.1 project with missing header file, that dependecies forgot.

zlib 1.3.1 Release Notes