Forum > Windows

Questions of new Strings in FPC 3.0

<< < (2/4) > >>

Cyrax:
You might find attached source file educating in this matter. It will demonstrate how to change codepage of standard output in console application (also its font) so characters will show correctly.

Unfortunately it is Windows only.

JuhaManninen:

--- Quote from: Cyrax on October 29, 2015, 03:44:19 pm ---You might find attached source file educating in this matter. It will demonstrate how to change codepage of standard output in console application (also its font) so characters will show correctly.

--- End quote ---

I guess Michl wanted to find a solution using system codepage, without using UTF-8.

Michl:

--- Quote from: Cyrax on October 29, 2015, 03:44:19 pm ---You might find attached source file educating in this matter. It will demonstrate how to change codepage of standard output in console application (also its font) so characters will show correctly.

Unfortunately it is Windows only.

--- End quote ---
Thank you very much - it is realy interesting!!! With this unit, the output for Strings works now, but it is a UTF8 string, not a CP1252. Maybe the answer near, I'll play with it a little bit ;)


--- Quote from: JuhaManninen on October 29, 2015, 04:22:19 pm ---I guess Michl wanted to find a solution using system codepage, without using UTF-8.
--- End quote ---
You are right. A solution is, to write all data into a file, the bytes there I can trust, the shown output in the console not.

And hey, that is just the first question, and I have created a lot of test cases ::)

Cyrax:
System code page is different than console code page. That is why Michl demo project fails.

If I execute command chcp in command prompt, it says that Active code page: 850.

marcov:
Console is in OEMSTRING:


--- 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";}};} ---type  OemString = type AnsiString(CP_OEMCP);
if not already predefined.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version