VB has a couple of native functions for converting a char to an ASCII value and vice versa - Asc() and Chr().
Now I need to get the equivalent functionality in C#. What's the best way?
...
Hello,
I am trying to send something to serial port (r232) with PHP.
I am using this class: http://www.phpclasses.org/browse/package/3679.html
The problem is that I am allowed to send only 1 byte.
But if I send something like "1", I am actually sending 49 (ASCII for 1).
Instead of send("1"), I tried with send(1) but it is no good, becau...
I have the following code in Perl:
if (index ($retval, $_[2]) != -1) {
@fs = split ($_[2], $_[1]);
$_[2] is the delimiter variable and $_[1] is the string that the delimiter may exist in. ($_[0] is used elsewhere) You may have guessed that this code is in a subroutine by those variable names.
Anyway, onto my question, when my del...
Hey everyone,
I have a set of 6 bits that represent a 7bit ASCII character. How can I get the correct 7bit ASCII code out of the 6 bits I have? Just append a zero and do an bitwise OR?
Thanks for your help.
Lennart
...
I'm creating a grammar using JavaCC and have run across a small problem. I'm trying to allow for any valid character within the ASCII extended set to be recognized by the resulting compiler. After looking at the same JavaCC examples (primarily the example showing the JavaCC Grammer itself) I set up the following token to recognize my cha...
If I have two strings, and I need to compare them in ASCII order (instead of the invariant culture order) I can generally use:
int c = String.Compare(a, b, StringComparison.Ordinal);
If I have a DataTable, and I want one of the columns sorted using an Ordinal string comparison for the DataView , how do I go about it?
...
This question is language agnostic but is inspired by these c/c++ questions.
How to convert a single char into an int
Char to int conversion in C
Is it safe to assume that the characters for digits (0123456789) appear contigiously in all text encodings?
i.e. is it safe to assume that
'9'-'8' = 1
'9'-'7' = 2
...
'9'-'0' = 9
in all...
I have some text that uses Unicode punctuation, like left double quote, right single quote for apostrophe, and so on, and I need it in ASCII. Does Python have a database of these characters with obvious ASCII substitutes so I can do better than turning them all into "?" ?
...
Hello,
Is it possible to check remotely (no local/FTP access) a URL to see if the webpage (file) was uploaded/created as binary or ascii?
Thanks,
Roy.
...
I need to convert large UTF-8 strings into ASCII. It should be reversible, and ideally a quick/lightweight algorithm.
How can I do this? I need the source code (using loops) or the JavaScript code. (should not be dependent on any platform/framework/library)
Edit: I understand that the ASCII representation will not look correct and wou...
Hi,
I'm looking for a library to draw ASCII graphs (for use in a console) with Python. The graph is quite simple: it's only a flow chart for pipelines.
I saw NetworkX and igraph, but didn't see a way to output to ascii.
Do you have experience in this?
Thanks a lot!
Patrick
EDIT 1:
I actually found a library doing what I need, but i...
I need a function that returns the ASCII value of a character, including spaces, tabs, newlines, etc...
On a similar note, what is the function that converts between hexadecimal, decimal, and binary numbers?
...
Character to value works:
$ printf "%d\n" \'A
65
$
I have two questions, the first one is most important:
How do I take 65 and turn it into A?
\'A converts an ASCII character to its value using printf. Is the syntax specific to printf or is it used anywhere else in BASH? (Such small strings are hard to Google for.)
...
I'm trying to extract the corners of a square in an image, I've managed to extract all the pixels around the square as x,y coordinates. Problem is now that I need to filter those down to only 4 corners I'm not sure what the best approach would be.
My first thought was to get the angles between each point and if the angle differs more th...
I have previously read Spolsky's article on character-encoding, as well as this from dive into python 3. I know php is getting Unicode at some point, but I am having trouble understanding why this is such a big deal.
If php-CLI is being used, ok it makes sense. However, in the web server world, isnt it up to the browser to take this i...
I would like to be able to convert a String (with words/letters) to other forms, like binary.
How would I go about doing this. I am coding in BLUEJ (Java).
Thanks
...
We often replace non-desirable characters in a file with another "good" character.
The interface is:
procedure cleanfileASCII2(vfilename: string; vgood: integer; voutfilename: string);
To replace all non-desirables with a space we might call,
cleanfileASCII2(original.txt, 32 , cleaned.txt)
The problem is that this takes a rather lon...
I want to convert a binary file into an array of ascii charcters . how can I do that .
thank you .
...
byte[] header = new byte[]{255, 216};
string ascii = Encoding.ASCII.GetString(header);
I expect ASCII to be equal to be FFD8 (JPEG SOI marker)
Instead I get "????"
...
I need to remove bullet symbols from text pasted from MS Word, but I can't figure out what to match on.
When printed to STDOUT the symbol displays as â¢
The ascii codes for these characters are 194 and 162.
The ascii code for • symbols is 149
Any suggestions how to proceed either in JavaScript or Ruby code?
...