localization - display German special characters correctly in Delphi 2007 -


i need display german special characters correctly in delphi 2007 characters "ü" appear "?" in label components

any advise

thanks

unexpected question mark (?) shows when text goes trough code page conversion fails.

since delphi 2007 not unicode enabled, label's caption ansistring. text you're putting in there goes trough @ least 1 code page conversion fails, , you'll have figure out conversion takes place , why it's failing.

common causes code page conversions:

  • the text label comes dfm (you wrote in object inspector). machine , test machine both use different "default code pages non-unicode applications". should never see while testing on machine.
  • the text label came database, , either database has wrong code page or test machine has wrong code page: when delphi helpfully tries convert code page, fails.
  • the character set property of label's font wrong.

here's bit of code put ü character in label testing. code selects easteurope_charset know i'm dealing code page 1250. i'm doing because other charset constants either select unusable code pages (that don't include "ü") or select code page depends on os (ie: no actual change).

procedure tform1.button1click(sender: tobject); begin   label1.font.charset := easteurope_charset;   label1.caption := char(252); end; 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -