ascii

How to get ascii value of character in haskell?

Just wondering how to get ascii value of character in haskell? I've tried to use the 'ord' function in ghci, based on what i read here: http://haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/Data-Char.html#6 GHCi, version 6.12.1: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading pac...

inconsistent sort behavior

I have a sample file containg "aA0_- " characters on each one on a single. Sorting it using GNU sort gives the following sort order: $ cat /tmp/sample | sort _ - 0 a A after appending some other character, we obtain a different order (non-alphanumeric characters seems to have lower priority): $ cat /tmp/sample | sed 's/$/x/' | sort ...

DOS ASCII Animation Lagging without constant input, Turbo C compiled

Here's an oddity from the past! I'm writing an ASCII Pong game for the command prompt (Yes yes oldschool) and I'm writing to the video memory directly (Add. 0xB8000000) so I know I'm rendering quickly (As opposed to gotoxy and then printf rendering) My code works fine, the code compiles fine under Turbo C++ V1.01 BUT the animation lags...

ASCII DOS Games, need help with Rendering methods!

I'm writing an old school ASCII DOS-Prompt game. Honestly I'm trying to emulate ZZT to learn more about this brand of game design (Even if it is antiquated) I'm doing well, got my full-screen text mode to work and I can create worlds and move around without problems BUT I cannot find a decent timing method for my renders. I know my ren...

How to Convert Extended ASCII to HTML Entity Names in Python?

I'm currently doing this to replace extended-ascii characters with their HTML-entity-number equivalents: s.encode('ascii', 'xmlcharrefreplace') What I would like to do is convert to the HTML-entity-name equivalent (i.e. © instead of ©). This small program below shows what I'm trying to do that is failing. Is there a way to ...

How do I reliably pull a text file of unknown encoding into an NSString on an iPhone?

Here is some code which I use to pull a text file into a UITextView called textView. Because I can't always know the file's encoding ahead of time, I use the method -stringWithContentsOfFile:usedEncoding:error:, which stores an encoding value by reference. Once I have the encoding, I then open up the file and, if there's an error, prin...

C++ ifstream UTF8 first characters

Why does a file saved as UTF8 (in Notepad++) have this character in the beginning of the fstream I opened to it in my c++ program? ´╗┐ I have no idea what it is, I just know that it's not there when I save to ASCII. UPDATE: If I save it to UTF8 (without BOM) it's not there. How can I check the encoding of a file (ASCII or UTF8, ev...

downgrade non-ascii symbols to closest 7-bit ASCII equivalent (preferrably Java)

Hello there, is there any simple/lightweight solution to change at least some of non-ASCII symbols to respective ASCII analogs? For example this string abc-åäö.txt should be changed to abc-aao.txt A bit of background: Zip-tools do not reliably support UTF-8, hence the need to downgrade. AFAICR Google "download attachments as sin...

how to convert an integer value to a specific ascii character in c++

I'm new to C++ and I'm trying to do something that should be pretty basic. I have a small loop in C++ that just displays a sequence of numbers and I would like to convert these numbers into specific ASCII characters. Something like this: for (int k = 0; k < 16; k++) { display(65+k); } And the result should look like t...

what is the ascii code of windows key?

what is the ascii code of windows key? in my c# application I want to lock or disable windows key. ...

Storing a char in a char pointer

I have a global variable that is a *char. My main function header reads as int main(int argc, char* argv[argc]){...}. These two lines of code have to remain the way they are. The first argument of my main function is a number of type *char, that I convert to a char using atoi(...);. I am basically changing the ASCII value to its corresp...

What is a vertical tab?

What was the original historical use of the vertical tab character (\v in the C language, ASCII 11)? Did it ever have a key on a keyboard? How did someone generate it? Is there any language or system still in use today where the vertical tab character does something interesting and useful? ...

RTFString Containing NSASCIIStringEncoding Special Characters?

I have a string in my cocoa GUI that needs to have special formatting (fonts, colors, etc.). Naturally, I'm using an attributed string. For convenience, I Init the string as an RTF: NSString *inputString = @"This string has special characters"; NSString *rtfString = [NSString stringWithFormat:@"{@"***LENGTHY RTF FORMATTING STRING *** %@...

Find similar ASCII character in Unicode

Does someone know a easy way to find characters in Unicode that are similar to ASCII characters. An example is the "CYRILLIC SMALL LETTER DZE (ѕ)". I'd like to do a search and replace for similar characters. By similar I mean human readable. You can't see a difference by looking at it. ...

Is there a unicode character that looks like an ascii one (but isn't equal)?

I'm wanting to write an pre-interview question (for java, but that's not important) that has a different answer if you look at it vs if you copy-paste it and run it so that we can check if people actually do the problem manually. To do this, I'm trying to find a unicode character that will look the same as an ascii character on-screen ...

How to get a Char from an ASCII Character Code in c#

Im trying to parse a file in c# that has field (string) arrays separated by ascii character codes 0, 1 and 2 (in Visual Basic 6 you can generate these by using Chr(0) or Chr(1) etc.) I know that for character code 0 in c# you can do the following: char separator = '\0'; But this doesnt work for character codes 1 and 2? ...

unzip utf8 to ascii

i took some files from linux hosting to my windows via ftp and when i check file encodings utf8 without bom now i need to convert those files back to ascii and send my other linux server i zipped files can i do something like unzip if its text file and ut8 format than convert it to ascii when i am unzipping files , i want to make con...

How to create a std::wstring using the ascii codes of characters in C++?

I need to create a wstring with the chars that have the following ascii values: 30, 29, 28, 27, 26, 25. In VB6, I would do asc(30) + asc(29)+ etc... What's the C++ equivalent? Thanks! ...

Displaying ASCII value of a character in c

I have accepted a character as an input from the user. I want to print the ASCII value of that character as an output. How can I do that without using any pre-defined function (if it exists) for the same? ...

How to find the ASCII Characters?

How to write a program to print the ASCII characters of the input given by user? ...