View Issue Details

IDProjectCategoryView StatusLast Update
0020552LazarusLCLpublic2011-10-26 13:59
ReporterChristianAssigned ToFelipe Monteiro de Carvalho 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product VersionProduct Build 
Target VersionFixed in Version0.9.31 (SVN) 
Summary0020552: GetDefauleSystemEncoding wrong for Console Apps
DescriptionIt uses for Windows internally GetACP, but on console Apps it should use GetOEMCP i think.
TagsNo tags attached.
Fixed in Revision33078, 33079, 33084
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

Vincent Snijders

2011-10-24 13:49

manager   ~0053360

Where is GetDefauleSystemEncoding defined?

Christian

2011-10-24 16:22

reporter   ~0053366

GetDefaultTextEncoding, from LConvEncoding Sry

Felipe Monteiro de Carvalho

2011-10-25 08:11

developer   ~0053395

Do you know any ocasion where they differ in anything except name?

Ludo Brands

2011-10-25 09:30

developer   ~0053398

Last edited: 2011-10-25 09:37

On my French XP I get:
GetACP : 1252
GetOEMCP : 850

All accented characters are on a different place in GUI and console. 1252 is also missing all box drawing characters used frequently in console apps.

1252:
  ! " # $ % & ' ( ) * + , - . /
0 1 2 3 4 5 6 7 8 9 : ; < = > ?
@ A B C D E F G H I J K L M N O
P Q R S T U V W X Y Z [ \ ] ^ _
` a b c d e f g h i j k l m n o
p q r s t u v w x y z { | } ~ 
€  ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ  Ž 
 ‘ ’ “ ” • – — ˜ ™ š › œ  ž Ÿ
  ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
à á â ã ä å æ ç è é ê ë ì í î ï
ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ

850:
  ! " # $ % & ' ( ) * + , - . /
0 1 2 3 4 5 6 7 8 9 : ; < = > ?
@ A B C D E F G H I J K L M N O
P Q R S T U V W X Y Z [ \ ] ^ _
` a b c d e f g h i j k l m n o
p q r s t u v w x y z { | } ~ ⌂
Ç ü é â ä à å ç ê ë è ï î ì Ä Å
É æ Æ ô ö ò û ù ÿ Ö Ü ø £ Ø × ƒ
á í ó ú ñ Ñ ª º ¿ ® ¬ ½ ¼ ¡ « »
░ ▒ ▓ │ ┤ Á Â À © ╣ ║ ╗ ╝ ¢ ¥ ┐
└ ┴ ┬ ├ ─ ┼ ã Ã ╚ ╔ ╩ ╦ ╠ ═ ╬ ¤
ð Ð Ê Ë È ı Í Î Ï ┘ ┌ █ ▄ ¦ Ì ▀
Ó ß Ô Ò õ Õ µ þ Þ Ú Û Ù ý Ý ¯ ´
­ ± ‗ ¾ ¶ § ÷ ¸ ° ¨ · ¹ ³ ² ■  

EDIT: This being said, the 2 code pages are for different uses and exist in parallel. I'm more in favor of adding a parameter to GetDefaultTextEncoding or creating a different function to retrieve console cp instead of modifying the default behavior of GetDefaultTextEncoding.

Christian

2011-10-25 09:32

reporter   ~0053399

MSDN tells to this:
Only the original equipment manufacturer (OEM) code page installed with Windows XP appears correctly in a command prompt window that uses Raster fonts.

I think thats dos compatibility stuff
in my case the command prompt codepage is 850 and GetACP tells 1252

Felipe Monteiro de Carvalho

2011-10-25 09:41

developer   ~0053400

I introducted a new function: GetConsoleTextEncoding

Christian

2011-10-25 10:12

reporter   ~0053401

Last edited: 2011-10-25 10:12

case cp of
    CP_UTF8: Result := EncodingUTF8;
  else
    Result:='cp'+IntToStr(cp);
  end;

Felipe Monteiro de Carvalho

2011-10-25 13:39

developer   ~0053408

If you want to reopen a bug please use english to explain why you are doing it.

Christian

2011-10-25 22:04

reporter   ~0053438

Iam Sorry i have reopened it becouse your fix is useless.
I have posted in the commed the corrected version.
You have declared an variable CP and Assigned the Codepage to it,
but it is not used.

Felipe Monteiro de Carvalho

2011-10-26 04:39

developer   ~0053441

Well spoted.

Christian

2011-10-26 13:59

reporter   ~0053458

great, thanks

Issue History

Date Modified Username Field Change
2011-10-24 13:44 Christian New Issue
2011-10-24 13:44 Christian Widgetset => Win32/Win64
2011-10-24 13:49 Vincent Snijders Note Added: 0053360
2011-10-24 14:34 Felipe Monteiro de Carvalho LazTarget => -
2011-10-24 14:34 Felipe Monteiro de Carvalho Status new => feedback
2011-10-24 16:22 Christian Note Added: 0053366
2011-10-25 08:11 Felipe Monteiro de Carvalho Note Added: 0053395
2011-10-25 09:30 Ludo Brands Note Added: 0053398
2011-10-25 09:32 Christian Note Added: 0053399
2011-10-25 09:37 Ludo Brands Note Edited: 0053398
2011-10-25 09:39 Felipe Monteiro de Carvalho Status feedback => assigned
2011-10-25 09:39 Felipe Monteiro de Carvalho Assigned To => Felipe Monteiro de Carvalho
2011-10-25 09:41 Felipe Monteiro de Carvalho Fixed in Revision => 33078, 33079
2011-10-25 09:41 Felipe Monteiro de Carvalho Status assigned => resolved
2011-10-25 09:41 Felipe Monteiro de Carvalho Fixed in Version => 0.9.31 (SVN)
2011-10-25 09:41 Felipe Monteiro de Carvalho Resolution open => fixed
2011-10-25 09:41 Felipe Monteiro de Carvalho Note Added: 0053400
2011-10-25 10:12 Christian Status resolved => assigned
2011-10-25 10:12 Christian Resolution fixed => reopened
2011-10-25 10:12 Christian Note Added: 0053401
2011-10-25 10:12 Christian Note Edited: 0053401
2011-10-25 13:39 Felipe Monteiro de Carvalho Status assigned => resolved
2011-10-25 13:39 Felipe Monteiro de Carvalho Resolution reopened => fixed
2011-10-25 13:39 Felipe Monteiro de Carvalho Note Added: 0053408
2011-10-25 22:04 Christian Status resolved => assigned
2011-10-25 22:04 Christian Resolution fixed => reopened
2011-10-25 22:04 Christian Note Added: 0053438
2011-10-26 04:39 Felipe Monteiro de Carvalho Fixed in Revision 33078, 33079 => 33078, 33079, 33084
2011-10-26 04:39 Felipe Monteiro de Carvalho Status assigned => resolved
2011-10-26 04:39 Felipe Monteiro de Carvalho Resolution reopened => fixed
2011-10-26 04:39 Felipe Monteiro de Carvalho Note Added: 0053441
2011-10-26 13:59 Christian Status resolved => closed
2011-10-26 13:59 Christian Note Added: 0053458