-3

I'm not expert in Delphi and I'm trying to add "Extended ASCII String" broken into individual character and then add into the TSgringGrid.Cells[x,y]. Some of the characters are getting displayed but rest of the characters are not shown in these cells. Another way for me is to convert these characters in Hex-Mode and then show it but this is not Required.

ChartSet used was OEM_CHARSET and Font = Terminal. I simply wish to display all 255 characters in Cell. Basically I wanted to created the Binary Editor like Edit.com in Delphi/ Lazarus which is available in XP.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • I wonder which characters aren't being shown. I also wonder why. Is that also your question? You didn't say. – Rob Kennedy Nov 10 '15 at 23:52
  • Yes. some of the characters are not getting shown. Ð Ð ò – Satyendra Shukla Nov 10 '15 at 23:53
  • For example: Hex Values "02 C2" are not visible on Cell – Satyendra Shukla Nov 11 '15 at 00:03
  • Does the encoding you're using recognize those as valid AnsiString characters? Hex value 02 is not a printable character anyway. How many bits does each character have in your environment? (That is, is `Char` an alias for `AnsiChar` or `WideChar`?) – Rob Kennedy Nov 11 '15 at 00:04
  • I'm using full set of 8 bits. I have to make sure 02 is displayed because I'm string to create the binary editor using StringGrid. Idealy there should be some way to show all 255 Ascii char. I've dedicated one cell each fro ascii char – Satyendra Shukla Nov 11 '15 at 00:09
  • Do you have some suggestion, so that I can use some other component to show the Asicii Characters (all 255). Just like MS XP's "edit.com" program shows all Ascii characters. – Satyendra Shukla Nov 11 '15 at 00:14
  • @SatyendraShukla: There are only 128 characters in the ASCII character set. You are obviously talking about some other character set. – Andreas Rejbrand Nov 11 '15 at 01:50
  • No. There are 0 to 255 http://www.delphibasics.co.uk/Article.asp?Name=Text – Satyendra Shukla Nov 11 '15 at 02:31
  • and I almost worked up with Terminal Font – Satyendra Shukla Nov 11 '15 at 02:49
  • The term *ASCII* appears just once on that page. Have you read that sentence carefully? It makes clear that it's talking about something *beyond* ASCII. ASCII has exactly 128 characters. – Rob Kennedy Nov 11 '15 at 02:51
  • ASCII has 128 characters. The remainder (up to 255) are **extended ASCII**. Regardless, the code you've posted is meaningless without the additional information people are asking you for - [edit] your question and add the relevant information there instead of burying it in comments. Before doing so, use the debugger to step through the code to try to see what's happening yourself. Then you can add **specifics** that we can use to try and help you solve the problem. – Ken White Nov 11 '15 at 03:33
  • AnsiToUtf8(chr(i) made my Day. – Satyendra Shukla Nov 11 '15 at 03:43
  • You have to know information about your encodings, and there's no such information here. Extended ASCII can mean many things. What do you mean? – David Heffernan Nov 11 '15 at 14:12
  • Extended ASCII means 127+ characters used by IBM. – Satyendra Shukla Nov 11 '15 at 16:56

1 Answers1

0

I used AnsiToUtf8(chr(i)) and it was solved.

Jens Borrisholt
  • 6,174
  • 1
  • 33
  • 67
  • Yes. It works because the string or char was converted to Extended IBC ASCII Chars. By default, the string as normal ASCII with 7-Bits. AnsiToUtf8(AnsiString(Decodeddata[i+1])) also worked. http://forum.lazarus.freepascal.org/index.php?topic=18999.0 – Satyendra Shukla Nov 11 '15 at 16:55