Cannot display Greek numbers in console (Ε ε, Ζ ζ, Η η, Θ θ, etc.) lazarus / 31-LCL ---------------------------------------------------------------------- -Caiman- · 2018-12-30 15:20 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i program greek; uses LazUTF8; vark: string; begin {Α α, Β β, Γ γ, Δ δ, Ε ε, Ζ ζ, Η η,Θ θ, Ι ι, Κ κ, Λ λ, Μ μ, Ν ν, Ξ ξ, Ο ο, Π π, Ρ ρ,Σ σ/ς, Τ τ, Υ υ, Φ φ, Χ χ, Ψ ψ, Ω ω.} k:= AnsiToUtf8('ϟʹ ϟʹ ϟʹ ϟʹ ϟʹ ϟʹ ϟʹ ϟʹ') ;writeln(k);writeln(UTF8ToConsole('ξ π'));writeln(UTF8ToConsole(k));wr iteln(UTF8ToConsole('АаБбВвЫыЪъЭэГгЩщ'));writeln(UTF8ToConsole('Υ υ, Φ φ, Χ χ, Ψ ψ, Ω ω.')); readln; end.  I tried to display greek numbers in console using LazUTF8 (+LCL package attached) but not working for me, even Rus letters are visible. Could someone help pls? ---------------------------------------------------------------------- jamie · 2018-12-30 15:53 lookup Code pages. Example  DefaultSystemCodePage := 1253 // Windows Greek  850 for MS-DOS multilingual .  Ect  You also have other code page areas to set.  DefaultUnicodePage := /////  ect ---------------------------------------------------------------------- lucamar · 2018-12-30 16:02 Are you sure your source is not UTF 8? If so, all those encoding conversions may be doing more harm than good. ---------------------------------------------------------------------- Bart · 2018-12-30 16:05 Lazarus/fpc 3.0.4 won't output then correctly. (The string is UTF8, the sourcode also, and contains a codepage utf8 directive) writeln(s) nor writeln(utf8toconsole(s)) works (where s is the string with greek letters). Bart ---------------------------------------------------------------------- -Caiman- · 2018-12-30 16:06 Quote from: lucamar on December 30, 2018, 05:02:40 pmAre you sure your source is not UTF 8? If so, all those encoding conversions may be doing more harm than good. How can i check my source correctly? ---------------------------------------------------------------------- lucamar · 2018-12-30 16:09 If you're using Lazarus and you didn't use any of the "change encoding" features then your source is UTF 8. ---------------------------------------------------------------------- Bart · 2018-12-30 16:10 If you use Lazarus IDE: check file settings (codepage), if it says UTF8 and the source compiles, it is UTF8 (compiler will complaine if byte sequense is not valid UTF8). Easier way: just copy the Greek text frome here (forum) fo Lazarus IDE. It will be correct UTF8. Bart ---------------------------------------------------------------------- -Caiman- · 2018-12-30 16:18 So guys will it display those letters correctly somehow with LazUTF8 lib added? Otherwise which method should be used here? ---------------------------------------------------------------------- -Caiman- · 2018-12-30 16:26 In general, did someone ever done similar program like Arabic, Roman, Greek numerals converter in pascal? Or at least smth with greek cuz i already have R to A and A to R. ---------------------------------------------------------------------- lucamar · 2018-12-30 16:43 You shouldn't need LazUTF8, at least not for this. At most you may have to use SetConsoleCP or SetConsoleOutputCP if you're in Windows, although even that is debatable. ---------------------------------------------------------------------- Bart · 2018-12-30 16:44 You can set the console codepage to UTF8. From an old sample project (mostly not my code): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$codepage utf8}uses  Windows; Type  CONSOLE_FONT_INFOEX = record    cbSize      : ULONG;    nFont       : DWORD;    dwFontSizeX : SHORT;    dwFontSizeY : SHORT;    FontFamily  : UINT;    FontWeight  : UINT;    FaceName    : array [0..LF_FACESIZE-1] of WCHAR;  end; function SetCurrentConsoleFontEx(hConsoleOutput: HANDLE; bMaximumWindow: BOOL;    var CONSOLE_FONT_INFOEX): BOOL; stdcall; external 'kernel32.dll' name 'SetCurrentConsoleFontEx'; var  New_CONSOLE_FONT_INFOEX : CONSOLE_FONT_INFOEX;  S: String; begin  //writeln('SetDefaultCodepages unit initialization: DefaultSystemCodePage = ',DefaultSystemCodePage);  DefaultSystemCodepage := CP_UTF8;  SetConsoleOutputCP(cp_utf8);  SetTextCodepage(Output, cp_utf8);   FillChar(New_CONSOLE_FONT_INFOEX, SizeOf(CONSOLE_FONT_INFOEX), 0);  New_CONSOLE_FONT_INFOEX.cbSize := SizeOf(CONSOLE_FONT_INFOEX);//  New_CONSOLE_FONT_INFOEX.FaceName := 'Lucida Console';  New_CONSOLE_FONT_INFOEX.FaceName := 'Consolas';  New_CONSOLE_FONT_INFOEX.dwFontSizeX := 8;  New_CONSOLE_FONT_INFOEX.dwFontSizeY := 16;   SetCurrentConsoleFontEx(StdOutputHandle, False, New_CONSOLE_FONT_INFOEX);    S :=  'Α α, Β β, Γ γ, Δ δ, Ε ε, Ζ ζ, Η η,Θ θ, Ι ι, Κ κ, Λ λ, Μ μ, Ν ν, Ξ ξ, Ο ο, Π π, Ρ ρ,Σ σ/ς, Τ τ, Υ υ, Φ φ, Χ χ, Ψ ψ, Ω ω.';  writeln(S);end. Outputs: Code: [Select]C:\Users\Bart\LazarusProjecten\ConsoleProjecten>test Α α, Β β, Γ γ, Δ δ, Ε ε, Ζ ζ, Η η,Θ θ, Ι ι, Κ κ, Λ λ, Μ μ, Ν ν, Ξ ξ, Ο ο, Π π, Ρ ρ,Σ σ/ς, Τ τ, Υ υ, Φ φ, Χ χ, Ψ ψ, Ω ω. Bart ---------------------------------------------------------------------- HeavyUser · 2018-12-30 16:45 Quote from: -Caiman- on December 30, 2018, 05:18:31 pmSo guys will it display those letters correctly somehow with LazUTF8 lib added? Otherwise which method should be used here? no it will not. the problem is that the codepage that your console is using does not support the greek characters no matter how many conversion you add if the characters are not present in the codepage table they will never show on screen correctly. So the two questions you should be asking are 1) what is the codepage of your console? on windows use the functions https://docs.microsoft.com/en-us/windows/console/getconsolecp and https://docs.microsoft.com/en-us/windows/console/getconsoleoutputcp to find out. 2) how do you change the console's codepage to either utf8 or any other unicode encoding that  supports all the characters you need. Everything else is pointless.