Pelles C > Bug reports

UTF8 issue on Windows 7

<< < (2/2)

MrBcx:

--- Quote from: Vortex on August 30, 2023, 09:53:27 PM ---Hi John,

Thanks for your tests.

--- End quote ---

Erol - I'm paying attention  ;)

TimoVJL:

--- Code: ---//#include <stdio.h>
int __cdecl printf(char*,...);
int main(int argc, char *argv[])
{
  printf("test");
  return 0;
}

--- End code ---

--- Code: ---10: pocc.exe -utf-8 test.c
fatal error: Unknown option: /utf-8.

11: pocc.exe -utf-8 test.c
test.c(5): fatal error #1065: Failed converting input using codepage 65001.

12: pocc.exe -utf-8 test.c
test.c(5): fatal error #1065: Failed converting input from 'U'.

--- End code ---

Pelle:
The /utf8 option means the execution character set and source character set is UTF-8, i.e. a source file without a BOM must be UTF-8 (7-bit ASCII is a subset of UTF-8 so will work, "exotic" ANSI characters will not work, etc.)

I don't have a Win7 machine for a quick test right now, I will see if it's possible to set up. ..

John Z:
OK interesting .....


--- Quote from: Pelle on September 10, 2023, 07:50:03 PM ---The /utf8 option means the execution character set and source character set is UTF-8, i.e. a source file without a BOM must be UTF-8 (7-bit ASCII is a subset of UTF-8 so will work, "exotic" ANSI characters will not work, etc.)

I don't have a Win7 machine for a quick test right now, I will see if it's possible to set up. ..

--- End quote ---

I note that the above mentions /utf8 not /utf-8 so I tried that on WIN7 home with PellesC v12.002 the object file was created and there was NO error message so next I made up a random fake command switch and I get the "unknown option" error as I should, and no obj file is created.

Then I tried /utf no error, /ut no error, /u shows switches list (and is valid switch to undefine pp symbol, although should be uppercase).  as long as /ut is there anything can be after it like /utf99999 with no error....

SO with the test.c file one can't really tell if utf-8 is working because all characters are 7bit ASCII which are valid so we should try with valid unique to UTF-8 and/or BOM however it appears that /utf8 or just /ut is/are valid switch input(s) and adequate for windows 7 and Pelles C version 12.00.02 with pocc version 12.0.1.0

I'm not saying it makes sense  :P  Going to test more ....

John Z

Pelle:

--- Quote from: John Z on September 13, 2023, 03:01:55 PM ---Then I tried /utf no error, /ut no error, /u shows switches list (and is valid switch to undefine pp symbol, although should be uppercase).  as long as /ut is there anything can be after it like /utf99999 with no error....

--- End quote ---
Good catch! It's /utf-8, but a missing break makes invalid cases like /utf8 fall into the following option case, were it will silently be "handled" (as in not casing a diagnostic) ...

About the original problem: I managed to boot up (literally) an old inherited laptop with Windows 7. The problem boiled down to the horror show of an API function called WideCharToMultiByte(); the flags and other parameters must match the Windows version (and the online documentation isn't exactly helpful) ...

Navigation

[0] Message Index

[*] Previous page

Go to full version