Click here to Skip to main content
15,896,526 members
Everything / ASCII

ASCII

ASCII

Great Reads

by Dev Leader
Change a picture into ASCII art using your own C# program
by Christian Specht
Overlay gallery images with logo using one of Hugo's available image filters
by Jovibor
Fully featured Hex Control written in C++/MFC
by Daniel Fisher (lennybacon)
About writing an image to ASCII converter.

Latest Articles

by Dev Leader
Change a picture into ASCII art using your own C# program
by Jovibor
Fully featured Hex Control written in C++/MFC
by Christian Specht
Overlay gallery images with logo using one of Hugo's available image filters
by sbarnes
A small utility that feature-creeped into Yet Another SCM tool - a useful app to examine

All Articles

Sort by Score

ASCII 

21 Oct 2023 by Dev Leader
Change a picture into ASCII art using your own C# program
5 Nov 2012 by OriginalGriff
OK - look at it in parts: srand((unsigned) time(NULL));Initialises a random number generator. const int passLen = 10; for (int i = 0; i
13 Jun 2016 by F-ES Sitecore
If you convert the ascii value for a letter into binary you'll see all the lower case ones start "011", so "a" is 01100001 and "z" is 01111010, and the upper case with "010" so "A" is 01000001 and "Z" is 01011010.ASCII - Binary Character Table[^]By "flag" they mean the position of one of...
7 Jun 2021 by Richard MacCutchan
Use the %X format type in your printf statement: printf - C++ Reference[^]
15 Nov 2012 by Sergey Alexandrovich Kryukov
Here is how:const char EnglishIndefiniteArticle = 'a';static char Translate(char input){ if (input == EnglishIndefiniteArticle) return 'ش'; return input;}Please, no offense: this is how your question could be understood, really. If you think it's something else,...
18 Jun 2013 by OriginalGriff
The first thing you want to do if you want a hex editor is to stop using strings: use byte values at all times - strings contain unicode characters which are of variable length, and do not have to be 8 bits.Read your file as bytes, store it as bytes and convert it to ASCII values for display...
20 Jun 2013 by lukeer
Have the value accessible as a property in some object. Two-way-bind that property to both visualisations. Convert to ASCII or hex nowhere but in the UI part.
24 Oct 2013 by Sergey Alexandrovich Kryukov
To remove blank spaces from a string, use:rettext = rettext.Replace(" ", string.Empty);Please see: http://msdn.microsoft.com/en-us/library/fk49wtc1.aspx[^].(Always use string.Empty instead of "", by a number of reasons.) It should work. If the string is not changes (are you 100%...
19 Jan 2015 by Peter Leow
Just save it as txt using the default ANSI encoding.
30 Jan 2015 by CHill60
Just checked and that is indeed a "non-breaking space" special character.Unfortunately the CLEAN() function does not remove it (because it is printable as a space)However fixedText =substitute(dodgyText,char(160),"") will tidy it up
10 Mar 2016 by OriginalGriff
Um.That string string string1 = "7210110810811132119111114108100";Isn't ASCII.ASCII is a character set, in much the same way as UNICODe is, but a lot smaller. Each character has a value: H would be 72 decimal, or 48 Hex, or (unusually these days) 110 in Octal. Your string may contain some...
5 Dec 2016 by Patrice T
You gave 2 ASCII strings showing hexadecimal values.To decode, you need to treat the strings in slices of 2 chars.for each slices in both strings, you have to convert into its numeric equivalent.Then XOR then, the result is the value of ASCII result you want.[Update]Use the debugger...
13 Nov 2017 by Jochen Arndt
You should have a device driver for the communication. This should provide functions to setup the interface and read and write data (usually with a pointer for the data and a size parameter). Quote: In the protocol there is a lot of Octets(octetos) which consists of 8 bytes that the protocol...
13 Nov 2017 by Patrice T
An octet is a byte: Octet (computing) - Wikipedia[^] Quote: ::= 05 Hexadecimal ::= 06 Hexadecimal ::= 15 Hexadecimal ::= 10 Hexadecimal Those are standard ASCII codes, this notation is used because those are non printable. Ascii Table - ASCII character codes and html, octal, hex and...
7 Jun 2021 by CPallini
You know, there is not an 'hexadecimal format' for a file. However, there could be a file containing the hexadecimal representation of binary (as well ASCII) data. To obtain such a file replace (as already suggested by Richard) Quote:...
26 Jan 2022 by Richard Deeming
Those bytes do not represent a valid sequence of ASCII characters. You cannot use the ASCII encoding to process them. You'll need to use the appropriate encoding for your text. For example: ASCII: ~>D??0E?? ISO-8859-1: ~>D€0E UTF-8:...
29 Jan 2012 by WBurgMo
I have an ascii text file that contains valid 8-bit character codes.How do I read this file and have the 8-bit char translated into validunicode? I know I could UTF8 encode the file or could read the bytesand then encode it. But this all assumes that I know about the 8-bitcodes before...
29 Jan 2012 by Sergey Alexandrovich Kryukov
Simply read withSystem.IO.StreamReader reader = new System.IO.StreamReader(fileName, System.Text.Encoding.ASCII);or, more universally, auto-detect the encoding:System.IO.StreamReader reader = new System.IO.StreamReader(fileName, true);It will give you Unicode...
29 Jan 2012 by Andreas Gieriet
Hello WBurgMo,there is no such thing like "valid 8-bit ASCII code" (see http://en.wikipedia.org/wiki/ASCII[^]).If you have plain ASCII 7-bit text, you may use the ASCIIEncoding to read the data. If you have some 8-bit extension of the ASCII 7-bit encoding, you must specify the code...
18 Jun 2013 by brknlpr
hello everybody I have question I am trying to do a hexeditor and I can read bin file in hex mode but I cannot read it as ascii.I am using this functionprivate static string hx2Asc(string hxStr) { byte[] tmp; int j = 0; tmp = new...
20 Jun 2013 by brknlpr
I am reading a binary file and one of them is in hexadecimal format in one richtextbox and the other is ascii form in another richtexbox as most of you know in hex editor when you change a code in ascii there is a change on hex form how can I access the other rtb and on which event should I...
20 Jun 2013 by CPallini
The index of the hex pair representing the character at index n is 2*n unless you have introduced separators.
24 Jun 2013 by Sharath2790
I've brought an application which sends data to another device through serial port. When I tried to sniff data using serial monitor. It showed something like this AA 41 0C 04 57 30 00 00 01 00 01 06 0F 1A Can any one help me with this?? What should I write in hyperterminal to get same result?
24 Jun 2013 by OriginalGriff
In hyperterminal? Nothing. It's intended as a terminal emulation - ie, a keyboard and a display - it has not facility for sending specific hex values, and you can't generate all of those codes from the keyboard.If you must use HT, then create small files using a hex editor and send those...
10 Oct 2013 by CAS1224
HiI'm hoping to find a way to change any lowercase letter to an uppercase no matter which letter is used. I saw online something about using the asciii values to accomplish this however I'm not sure how this would be applied to every letter. This I believe will convert lowercase b to...
24 Nov 2013 by OriginalGriff
The first thing to do is stop doing that! Do not concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Use Parametrized queries instead.When you concatenate strings, you build a new string...
2 Feb 2014 by choudhary.sumit
Hi all I have a xml file which contains many html entities (“,”,—). i just want to convert these entities to ascii to unicode (“,”,—). Please suggest some methods.Note: httpUtility.htmlDecode did'nt work for me.
10 Aug 2014 by Richard MacCutchan
For example, in the code:Write (“Please enter Name of family member”) Input FN Set FN[count]=countYou are trying to read some text into a variable called FN, but you previously declared FN as a 50 element array of strings, so you cannot read into it in this way....
30 Jan 2015 by hcompston
HiI was writing a simple replace script to remove all spaces from a EXCEL Spreadsheet using the built in VBA editor. The code looked to be running fine on data that had been copied and pasted into a blank spreadsheet. However I noticed that some spaces remained. On copying one of these into...
18 Mar 2015 by Soft009
Hi,I have write two methods to convert Hex string to ASCII and ASCII string to Hex string. But when I compare the two strings it I getting two difference Hex strings.Eg:Hex string = 6220000008a01000I convert this string to ASCII using below method public static string...
18 Mar 2015 by raymondyam
Try this:public string ASCIItoHex(string Value){ StringBuilder sb = new StringBuilder(); foreach (byte b in Value) { sb.Append(string.Format("{0:x2}", b)); } return sb.ToString();}
22 May 2015 by Member 11712323
I wrote a program for converting a file from PPM format to ASCII art. Every pixel of the input image is converted to greyscale by calculating the average of red green and blue values ((red + green +blue)/3).The upgrade of the basic version is that I calculate the average of RGB in a window...
26 May 2015 by bling
Everything looks good until I see this:int blockx, blocky;for(blockx = 0; blockx
7 Jul 2015 by Sergey Alexandrovich Kryukov
It does not mean "Hex string to ASCII". Java strings are not ASCII, they use Unicode. ASCII codes is what you expect from the user, in the form of numeric string, no matter hexadecimal or decimal, and on output you need characters.Also, you need to validate the user input, to allow only...
17 Dec 2015 by Richard MacCutchan
A binary integer is as long as it needs to be to hold its value. Common sizes are 16, 32 or 64 bits, depending on usage and requirements.
15 Jan 2016 by Patrice T
STX and ETX usually refer to ASCII control charactersControl character - Wikipedia, the free encyclopedia[^]An ASCII control character can't be displayed, thus to show you where to put them, it is a common usage to show them as [STX] and [ETX] but you have to replace them by their ASCII...
15 Jan 2016 by Jochen Arndt
It seems that you use a sensor described in this PDF document: Telegrams for Configuring and Operating the LMS1xx, LMS5xx, TiM3xx, JEF300, JEF500[^].But that describes the communication via a terminal program (serial connection). If the sensor is connected to a serial port, you must use...
5 Feb 2016 by Zhivko Kabaivanov
Hello.I am trying to paste some text form the clipboard to a specific field that is in some application. The application is on Windows 7, the Language for non-Unicode programs is set to that Cyrillic language. I have copied Cyrillic characters to the clipboard, something like "Петър"....
10 Mar 2016 by Member 12135144
I recently started learning about ASCII and what role it plays in C# development and I was wondering how can I convert ASCII characters into a string? For instance if I have (7210110810811132119111114108100) which would print out Hello World, how would I convert these numbers into readable...
10 Mar 2016 by Patrice T
Quote:For instance if I have (7210110810811132119111114108100) which would print out Hello World,You look pretty confused. Forget this for now and learn properly C# instead. the problem (which don't exist) will be resolved by itself.
10 Mar 2016 by Sascha Lefèvre
Your string "7210110810811132119111114108100" is constructed by appending the character values formatted as decimals without leading zeroes. So a single character could be represented by 1 to 3 digits. It's impossible to reverse this to a character sequence (string) because an algorithm couldn't...
13 Jun 2016 by rolandoelninoz
hello, i try to study bout ascii code todayi got some information from Lesson 6.6 : How numbers are encoded as characters in ASCII - YouTube[^]i got some question about 'flag' in asciias what has been mention in this video the 1st 3 digits in ascii code010 represent upper case...
14 Oct 2016 by H.AL
I am using Asciistr method in oracle which is supposed to convert given structure to ascii. Arabic characters are converted correctly but english are still the same while in some online converters I can see that numbers like 1 and 2 are converted to 0031 and 0032. Here is my method:create or...
14 Oct 2016 by Richard Deeming
According to the documentation[^], the ASCIISTR function only converts non-ASCII characters.English letters and the standard Arabic numerals (0-9) are all valid ASCII characters. Therefore, they won't be converted.
8 Jan 2017 by Member 12609228
I have created an application where I need to control a Digital to Analogue Converter (DAC) using horizontal trackbar control in VB.Net.I have used checkbox (appearance: button) to control relays to switch them on and off and I'm sending Ascii values from program to do it.Is it possible to...
8 Jan 2017 by Garth J Lancaster
How do you mean 'send ascii values to the trackbar control' ... ? you can set the Value, Minimum and Maximum for a trackbar - this may help Windows Control: The Track Bar[^] notice you're usually using a trackbar to set/get an 'integer' value between a range [min, max]
21 Apr 2017 by Member 13143502
Good Morning! I have a project that basically grabs my character name from a running process using ReadProcessMemory and returns the values as Hex. I'm having trouble converting this string of Hex values to Ascii characters... Example Below! Value I am returned: 4d-79-4e-61-6d-65-31-00-00-00...
21 Apr 2017 by OriginalGriff
It depends on exactly what you are getting: if it's the bytes 4d, 79, 4e, ... then it's fairly simple: Dim s As String = System.Text.Encoding.UTF8.GetString(_dataBytes) If it's a string: "4d-79-4e-61-6d-65-31-00-00-00" then it's more complex: first convert that to bytes, then convert the bytes...
21 Apr 2017 by Member 13143502
I was able to resolve this issue by modifying the GetBytes function Public Function ReadString(ByVal addr As IntPtr) As String 'Int32 data type-- is 32 bits long, 4 bytes. Dim _dataBytes(10) As Byte ReadProcessMemory(_targetProcessHandle, addr, _dataBytes, 10,...
20 Feb 2018 by Member 13688224
I need to get the ascii value of delete key by user input or cin. What I have tried: I know the delete key has an ascii value of 127. I can also get this by using: static_cast('/x7f') or some similar sequence, but i need to get it via user input. How can i do that?
20 Feb 2018 by Suvendu Shekhar Giri
I remember we used to do something like following during college days as I no more use C++. Check if it helps- char c; c=getch(); cout
18 Apr 2018 by NiRaj Wagh
The code is implemented using ADT by including the "stack.h" user defined header file. The header file has code for stack operation. I am getting wrong outputs for results greater than 9. What changes should I make in the code to get the correct output. I have to use a stack with char data...
18 Apr 2018 by Richard MacCutchan
s.push(res+'0'); That will only work for a single digit result. In your case, 6 * 3 = 18. The character '0' is equivalent to 0x30, or decimal 48. 48 + 18 = 66 or hexadecimal 0x42, which is the numeric value of the ASCII character 'B'.
18 Apr 2018 by Patrice T
Quote: for postfix expression "63*" I am getting result as B. Guilty is: s.push(res+'0'); because the code is correct only for single digit values. In order to handle numbers with more than 1 digit, you need to have separator between numbers, a space is usually used for this: 2 63 3*+ My...
18 Apr 2018 by Jochen Arndt
You are pushing single digits / characters on the stack. When a number is greater than 9 you will push multiple digits that must be all popped and converted to a number. It all depends on how the input is formatted. Assuming something like "num1 num2 op", I suggest to write functions to push...
24 May 2018 by Shaikh Jani Ashraf
Hi I am getting the same exception when i convert the very large files data pulled from MongoDB and converted to string then to ASCII. Here is the line of code. Data = Encoding.ASCII.GetBytes(inputParameters.ToString()); where input parameters has DB data. And I have one more question is Is...
18 Jul 2018 by Member 13917072
I have a string which contains "C3A1" which is the utf-8 equivalent of á How do I convert this to á in Java. What I have tried: I've tried some ways to parse it as a char but nothing's worked
18 Jul 2018 by Jochen Arndt
If you have a byte array representing an UTF-8 string use the Java String constructor accepting a byte array and an encoding: String str = new String(utf8Bytes, "UTF-8"); If you really have a String object containing an UTF-8 string, you have to convert it first to a byte array: byte[] utf8Bytes...
1 Aug 2018 by Richard MacCutchan
Use the Encoding class to convert a string to ASCII bytes: Encoding.GetBytes Method (String) (System.Text)[^].
1 Aug 2018 by James_Parsons
I'd consult with the documentation for whatever device you have and ensure that the command is sent right. Even if SerialPort does write in ASCII by default, you need to make sure any necessary control characters and line endings are sent correctly. As noted in a previous solution, you can use...
24 Oct 2019 by Member 13870672
I have a large text file. Portion of the file dictates what variables will follow and in what order # Time # Depth # Variable 2 # Var 3 # Var 4 (Following after this, this dictates how many columns) 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000...
24 Oct 2019 by RickZeeland
A text box is not really suited for your purpose, a DataGridView is a better choice. See the answer here by Maciej Los here: How to read text file data and display in datagridview with VB.NET[^]
12 Aug 2020 by Dave Kreskowiak
Google for "replace a string resource in DLL" for options. Keep in mind that this is NOT AN ANSWER! This is POSSIBLE solutions that are not guaranteed to work with your .DLL. If you are modifying a DLL that is signed, your modifications will...
30 Jan 2021 by Dave Kreskowiak
It's nothing but splitting the string into an array of strings, then iterating over the array and converting each of those small strings into an integer, then a character. Look at the String.Split()[^] method. By the way, those values will not...
27 Apr 2021 by Member 13362351
i am trying to connect with a temp sensor that use ASCII commands ... when i use arduino serial monitor to test commands the sensor respond well, but when i try to use C# i get different ressult. Through arduino serial monitor (all great): The...
7 Jun 2021 by Member 12091625
Hi I’m not the best at C but I’m trying to write a C program that basically opens a text file Which contains ascii text and its working fine now I want that it convert ascii data into HEX and save into different file in HEX format kindly help me...
15 Sep 2022 by Christian Specht
Overlay gallery images with logo using one of Hugo's available image filters
18 Dec 2022 by OriginalGriff
The value you get is the value in your original string converted from hex characters to a string - the code you show works. But ... it's way too short to be any realistic image, (even as a icon bitmap, it would only be about 3 pixels by 4) so...
19 Jan 2023 by Member 14623639
I have a program which sends header with file encoded using Encoding.ASCII.GetBytes(byte[]); but it seems that this won't work with arbitrary data. I tried sending image, videos, audio files which gets corrupted but text files such as pdf, text,...
19 Jan 2023 by Sandeep Mewara
First off, would not suggest to use ASCII encoding. As mentioned here[^]: Quote: ASCIIEncoding does not provide error detection. Any Unicode character greater than U+007F is encoded as the ASCII question mark ("?"). For security reasons, you...
19 Jan 2023 by lmoelleb
You should not use any text encoding on binary data like images. Use System.Convert.ToBase64string to to get a text string representing your data, then use System.Convert.FromBase64String to get your data back once it is received. ASCII will...
12 Feb 2023 by Navid Rigi Ebrahimi
Hey guys. How can I print a null character in the middle of a string and how to tell the program that this is not the null character of string's end? I want to print characters of a string one by one, but when it reaches to null in the middle,...
11 Feb 2023 by OriginalGriff
Pretty much, you can't - in C, a null character is considered a string terminator - encountering one marks the end of the string. If you want to include nulls in your data, you should be using unsigned char datatypes, and not trying to use...
12 Feb 2023 by CPallini
You should write a function accepting an array of char (or, better, unsigned char), say a, and its size, say size. In the function, implement a loop, with n=0,1,..,(size-1): If a[n] is printable (see isprint[^]) then print it (using, for...
14 Dec 2022 by Jovibor
Fully featured Hex Control written in C++/MFC
30 Jan 2005 by Daniel Fisher (lennybacon)
About writing an image to ASCII converter.
13 Feb 2014 by sbarnes
A small utility that feature-creeped into Yet Another SCM tool - a useful app to examine
10 Oct 2013 by Andreas Gieriet
The safe way is to do something like:char c = ...;if (islower(c)) c=toupper(c);orwchar_t c = ...;if (iswlower(c)) c=towupper(c);See also http://www.cplusplus.com/reference/cctype/islower/[^] for char based text, or http://www.cplusplus.com/reference/cwctype/iswlower/[^] for wchar_t...
5 Dec 2013 by Ron Beyer
A simple Google search of "What is ASCII" would give you this[^].
5 Nov 2012 by Parwarrior7
Hello everyone,In my program I have to generate a random number/capital letter and cast it as a char.Online I was able to locate an algorithm that does nearly that:int main() { srand((unsigned) time(NULL)); const int passLen = 10; for (int i = 0; i
13 Nov 2017 by KarstenK
You should work with buffers of 8 byte size. You can call it "octet". byte octet[8];// or char strncpy( octet, "it works", 8); Pay attentation that in a normal string the last element is the terminating zero, so you have 7 chars "payload". It also possible to use the 8th byte, when the code...
10 Oct 2013 by greg19
The difference between the ASCII value for A (65) and a (97) is 32. This is the same for all letters. You can simply subtract 32 from the lower case value and that would be the upper case equivalent.
5 Dec 2013 by Member 8478234
Acronym for the American Standard Code for Information Interchange. Pronounced ask-ee, ASCII is a code for representing English characters as numbers, with each letter assigned a number from 0 to 127. For example, the ASCII code for uppercase M is 77. Most computers use ASCII codes to represent...
24 Oct 2013 by saleem_deek
Hi,I am reading a Microsoft Office Word text from a vb.net app, and then storing the formatted string in another ans file. Somewhere in this file I am finding 4 unreadable characters. I went in debug mode and I found out that the Asc code of each of these characters is 32 !!Normally this is...
5 Feb 2016 by Sergey Alexandrovich Kryukov
This is what actually should happen to non-Unicode text. It's very likely that it's one of the obsolete Cyrillic-specific encodings. It could be Windows 1251 or KOI8-R:Windows-1251 — Wikipedia, the free encyclopedia[^],KOI8-R — Wikipedia, the free encyclopedia[^].Too bad, there are a lot...
24 May 2018 by Jinto Jacob
there are many reason for this exception. Please review the stack trace for more information about the error and where it originated in the code. there is a detailed description available ... click here to visit the link...
10 Oct 2013 by Richard MacCutchan
You can use these functions[^] or these[^]. Or simply subtract hex 20 (decimal 32) like:char lowerChar = 'b';char upperChar = lowerChar - 0x20;NB you should check first that the character is lower case as described in the documentation links above.
24 Nov 2013 by AhmadDb
Hello I have a string variable contains Ascii Code in it . I tried to save it in (nvachar),(Text) fields in the database but the database adds several (?) characters to it . Why does that happens?And how to store that variable correctly?Here is the codeusing (SqlConnection...
28 Jul 2019 by Member 13924847
I am developing a configuration tool in C#. I am beginner in C#.I am using winforms for my application. I have a serially connected device which send back respond on specific ascii command. Till now I can create and open port able to get the default response in list box. But I can not able...
28 Jul 2019 by Anthony Carson
using System.IO.Ports; namespace ArduinoWireless { public partial class Form1 : Form { string dataIN; string dataIN2; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { ...
15 Nov 2012 by killing the bug softly...
Replace the existing one with you want on keypress event
19 May 2022 by User1454
Hi, How to convert "!q44499:²о888=º88Š" to "19217134343439393AB205D0BE383838133DBA38388A". I have tried Encoding.Default.GetBytes("!q44499:²о888=º88Š"). But for character "&sup2" I get "3f", instead of "b2".Please help.
5 Dec 2013 by Gadgetzoned
Dim keyascii As String = e.KeyChar Dim chback As String chback = Asc(e.KeyChar) If chback = 8 Or keyascii >= "0" And keyascii
10 Aug 2014 by Member 11003651
I am writing my final project for my intro to problem solving and algorithm design class and I'm having a bit of trouble correcting it. I submitted it last week and I received some feedback from my professor, but I'm a little lost. Here's the psuedccodoe and design that I...
7 Jul 2015 by User1454
Hi, I have a problem in converting hex string to ascii string in java, i.e. if the user enters "06", my application should convert it to "0x30 0x36" and pass this value to a byte array. Please help me out....
15 Nov 2012 by Christian Graus
If you want to convert one character to another in a string, use the Replace method of the string class. If that's not what you mean, explain further.
17 Dec 2015 by Hitesh Jain
Size Of Each Character In ASCII (StreamWriter In C#) Takes 1 Byte Whether It Is Number Or Character . Similarly What Will Size Of Each Character , Integer In Binary (BinaryWriter In c#) . Can Some One Explain In Brief ?
13 Nov 2017 by Tecnico guardiancar
I'm trying to write some minor code for requesting a response for a electric meter using an optical probe. The cable is still arriving, so while I'm waiting, I have to write the code for it, and I have no clue. The protocol is ABNT NBR-14522 which is based on IEC-62056 and ANSI-C12.2....
12 Aug 2020 by jack dannils
http://i.epvpimg.com/jSVEbab.p...
18 Dec 2022 by Member 13297861
dear all please help i have a code hexadecimal like this 0001040A0C0A03041A436463472D242324262620161214181C242D353E545E5F5D574D423A322519130F0905030202020101 and i get instruction like that "50 sets of 2-digit hexadecimal data, converted to...