Forum > FPC development

UpperCase, ToUpper, LowerCase and ToLower bug or my misunderstanding?

<< < (2/2)

marcov:
Note in the icon/manifest project section there is a tick to use the newer Windows 10 utf8 default option

Kays:

--- Quote from: avra on July 15, 2021, 01:23:29 pm ---@Kays: I must admit that I didn't expect to see that FPC does not have any Upper derivate that goes beyond ASCII. Maybe there is a way to let OS handle it?
--- End quote ---
OS? No, that ain’t no task of an OS.

--- Quote from: avra on July 15, 2021, 01:23:29 pm ---[…] Strange, right?
--- End quote ---
No, because, as mentioned above, the behavior of ANSIUpperCase depends on the utilized wide string manager. The following works on a Linux system:
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---program cyrillicUpcase(input, output, stdErr);uses        {$ifDef UNIX}                CWString,        {$endIf} sysUtils;begin        writeLn(ANSIUpperCase('Укључено'));end.

avra:

--- Quote from: ASerge on July 15, 2021, 05:20:59 pm ---When you add LazUtils, it replaces the AnsiUpperCase call with UTF8UpperCase, which understands UTF8.
--- End quote ---
I did not use LazUtils anywhere in bithelpers demo, but maybe some of the used units uses it. Thanks for the info!


--- Quote from: marcov on July 15, 2021, 05:28:49 pm ---Note in the icon/manifest project section there is a tick to use the newer Windows 10 utf8 default option
--- End quote ---
I was not aware of that. Thanks! That can not be applied to console applications, right?


--- Quote from: Kays on July 15, 2021, 05:35:46 pm ---
--- Quote from: avra on July 15, 2021, 01:23:29 pm ---@Kays: I must admit that I didn't expect to see that FPC does not have any Upper derivate that goes beyond ASCII. Maybe there is a way to let OS handle it?
--- End quote ---
OS? No, that ain’t no task of an OS.
--- End quote ---
So what are functions like CharUpperBuffW() or LCMapStringA() doing in Windows API?


--- Quote from: Kays on July 15, 2021, 05:35:46 pm ---behavior of ANSIUpperCase depends on the utilized wide string manager. The following works on a Linux system
--- End quote ---
Thanks! It's more clear now.

So, it's not a bug after all...

ttomas:
@avra, look at LazUtils as FPC library, not as LCL dependency. Maybe is good to move LazUtils to FPC or I'm wrong?

marcov:

--- Quote from: avra on July 15, 2021, 10:25:35 pm ---
--- Quote from: marcov on July 15, 2021, 05:28:49 pm ---Note in the icon/manifest project section there is a tick to use the newer Windows 10 utf8 default option
--- End quote ---
I was not aware of that. Thanks! That can not be applied to console applications, right?

--- End quote ---
[/quote]

Afaik it can.

Navigation

[0] Message Index

[*] Previous page

Go to full version