FAQ Database Discussion Community

## how to convert from ascii code to normal code in python? [closed]

python,performance,ascii
I'm almost new in python and i want to solve a question,which is the AlphabetRunEncryption(str) function,that read the str parameter being passed which will be an encrypted string and the output should be the original decrypted string. Now I need a function or a fast and easy method to convert...

## How to convert ascii / 7bit email to utf8?

php,email,utf-8,ascii,imap

## ASCII Space Character in Ruby Unicode Escape

ruby-on-rails,ruby,unicode,encoding,ascii
Doing some reading and came across this block of code on the topic of Unicode Escapes in Ruby: money = "\u{20AC 20 A3 20 A5}" # => "€ £ ¥" I understand that in this ruby syntax, the actual spaces between the {}'s doesn't output an encoded space, that's the...

## Why is backspace allowed in my jQuery whether I filter it out or not?

jquery,ascii,keypress,backspace

## Block typing in any other alphabet than english

javascript,validation,ascii,fromcharcode
I know the JavaScript that restricts entering some special characters or number, etc using charcode and ascii value. Is there anyway that I can block people entering any other language (I mean alphabet) expect English? More specifically how can I block people entering Chinese or some other non English alphabet...

## Blender fbx import from ascii format

import,ascii,blender,fbx
I have a FBX model which I would like to open in Blender but when I try to import the model it says: ASCII FBX files are not supported. Is there a way to import the model to Blender somehow? I don't have access to any Autodesk software.

## Is it possible to make conditions in ASCII? [closed]

ascii
I am working on a software that needs commands in ASCII to define alert thresholds. These thresholds, correspond to a quantity in littre according to a number of gas tank connected each others. Examples : -If it's 1 or 2 tanks the threshold will be 30 L and the ASCII...

## Convert each letter of string into ascii values - java

java,string,ascii
I want to add two strings and remove duplicate characters of the string then I want to convert each letter of the string into ascii values. After converting, I want to add each letter ascii values and get a total amount of the values.. for ex: ab+ab ab // remove...

## Random HTML characters being encoded in emails

php,utf-8,ascii,html-email,quoted-printable
I'm generating an email with PHP that outputs an HTML table. Most of the table comes through fine, but some of the < and > characters are randomly encoded to &lt; and &gt;. It doesn't always do it in the same place. Sometimes it just happens in one place, sometimes...

## Most efficient way to convert ASCII to Binary in x86 Assembly

assembly,binary,x86,ascii
I have a number stored in memory as ASCII and want to convert it to its binary value (multiplied by 100). so 1.23 may be stored in memory in ASCII as 0x312E3233 and this should be converted to the binary value 123. I currently have the following but is there...

## LINQ OrderBy igorning case with true ASCII ordering

c#,.net,linq,sorting,ascii
I'm trying to sort strings ("A", "_", "a") using LINQ in C# in ASCII order while ignoring case sensitivity. According to the ASCII table, the strings I'm interested are: A = 65 _ = 95 a = 97 So I would expect the output to be A, _, a However...

## What's the simplest way to convert from a String to an ascii value in Swift?

string,swift,ascii
I just want to get the ascii value of a single char string in Swift. This is how I'm currently doing it: var singleChar = "a" println(singleChar.unicodeScalars[singleChar.unicodeScalars.startIndex].value) //prints: 97 This is so ugly though. There must be a simpler way....

## Regex Latin characters filter and non latin character filer

c#,regex,ascii,non-ascii-chars
I am developing program ,where I need to filter words and sentences which is non Latin character. The problem is, that I found only Latin character words and sentences , but I do not found words and sentences which are mixed with Latin characters and non Latin characters. For ex....

## Remove ASCII Question Mark

java,ascii
I have the following String passed from another application. 2&#65533;4&#65533;9&#65533; (2�4�9�) I would like to remove question mark ascii characters from the above string. How could I do this?...

## How do I convert a letter to an ASCII value? [closed]

java,char,ascii,value
Let's say char c = s How would I convert S into an ASCII value? ...

## Converting a binary string to an ascii string, the long way (No API Functions)

java,algorithm,binary,ascii
I had an interview recently and discovered that I'd forgotten some of the basics. I've been playing around again and have written a function that will take a binary string (there is no validation yet) and returns the ascii representation of said string. I'm looking for advice or tips on...

## Regex to match ASCII Table character with decimal value

regex,decimal,ascii
So I need a Regex to match the ASCII character STX(Start Of Text) which is number 2 on ASCII Table. I tried ^ as Regex101.com suggest for start of text but it was unsuccessful. Then I tried [[:ascii:]] which was matching for all ASCII characters. Is there any way to...

## Convert unicode URL to ASCII

php,unicode,encoding,ascii
I'm writing a PHP application that accepts an URL from the user, and then processes it with by making some calls to binaries with system()*. However, to avoid many complications that arise with this, I'm trying to convert the URL, which may contain Unicode characters, into ASCII characters. Let's say...

## How to print the ASCII value of a int in C++?

c++,ascii
I'm beginner in c++ and I want to write a program that prints the ASCII value of the alphabet ('a', 'b',.... 'z') and of the numbers ('0'...'9'). I'm able to print the ASCII value of the alphabet using the "int()" function. Example: char a = 'a'; std::cout<<int(a); The result of...

## Buffered Writer unable to process from array [closed]

java,arrays,ascii,filewriter,bufferedwriter
I am using a bufferedwriter to write to a file from an array: int[] scores = new int[5]; for (int i = 0; i < 5; i++) { scores[i] = 2; //Array of twos } try { BufferedWriter output = new BufferedWriter(new FileWriter(new File("Scores.txt"))); output.flush(); for (int i = 0;...

## How does Python handle non-printable characters? [closed]

python,encryption,character,ascii
I'm making a program that encrypts a file using keys. It can encrypt only numbers, letters, spaces, some symbols. Etc. This is text >>> h5D#I2%%&12s My program can encrypt a file, too. (At least I'm working on it) What if file contains characters like this ? - uún‰3«°Ø and also...

## NSData to NSString losing data

nsstring,ascii,nsdata,nsstringencoding
I'm attempting to convert a binary file into text, the problem is that a large portion of the file was not encoded in ascii and ends up being special characters. I'm using [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; but am only getting a few characters back in a 20000 byte data block....

## How to convert Hangul letter(symbol) to latin [closed]

java,unicode,ascii
Language could be java. This is what I would like to accomplish: Basically, print out the pronunciation of the Hangul written word. ...

## Performing a sort using k1,1 only

linux,sorting,text,ascii
Assume you have an unsorted file with the following content: identifier,count=Number identifier, extra information identifier, extra information ... I want to sort this file so that for each id, write the line with the count first and then the lines with extra info. I can only use the sort unix...

## How do I generate 8 different random numbers in python?

python,random,ascii
I'm trying to write an encryption program that generates 8 different random numbers and converts them to ASCII. If possible I'd like to use the 'random' function in python, but welcome other help. So far my code for generating the numbers is to assign a value to a different run...

## Save matrix without the initial tab in ascii-file

matlab,file,ascii
I have a matrix vtx that contains XY coordinates and I want to write it into a file that already exists, with some custom headers. I use the line save('z2.vtx','vtx','-ascii','-append'); to save the matrix in to the specific file. The problem is that I would like each row NOT to...

## What does stripping off the ASCII template mean?

assembly,ascii,cpu-registers,computer-architecture,lc3
I am working on a practice exam problem The Problem On execution of this program, the user inputs two numbers. What is the value of xGuess so we can strip off the ASCII template? Explain. .ORIG x3000 TRAP x23 LD R2, ASCII ADD R1, R2, R0 TRAP x23 ADD R0,...

## code gives out ASCII numbers instead of characters

c++,char,ascii,red-black-tree
This code is part of a RedBlack Tree program supposed to receive "ADSOMERT" and sort its characters into Inorder form "A D E M O R S T". It does the job, but with the ASCII numbers of each character "65 68 69 77 79 82 83 84". Main function:...

## Python - ASCII encoding string in the unicode string; how to remove that 'u'?

python,unicode,encoding,ascii,urlencode
When I use python module 'pygoogle' in chinese, I got url like u'http://zh.wikipedia.org/zh/\xe6\xb1\x89\xe8\xaf\xad' It's unicode but include ascii. I try to encode it back to utf-8 but the code be changed too. a = u'http://zh.wikipedia.org/zh/\xe6\xb1\x89\xe8\xaf\xad' a.encode('utf-8') >>> 'http://zh.wikipedia.org/zh/\xc3\xa6\xc2\xb1\xc2\x89\xc3\xa8\xc2\xaf\xc2\xad' Also I try to use : str(a) but I got error :...

## how to grep ASCII control character

grep,ascii
If I have a file containing ASCII control character, for example, ^A (Start of Header). How can I find it using grep in Linux?...

## Loss of quotes when encoding into ascii

python,regex,utf-8,ascii
I wish to extract the text between quotations from news articles. For this purpose the first step involves extracting the new articles. Then in the second step using a regex to get the quotations. I am not sure but the quotations get lost when I encode into ascii. Is there...

## Why is ASCII representation of this character returns as 226 128 153?

encoding,character-encoding,char,ascii
So I am playing with this tool: http://www.unit-conversion.info/texttools/ascii/ When I try this character: ' I see the value 039 which can be verified from: http://www.asciitable.com But I am curios about: ’ This character in the same tool will return: 226 128 153 But as far as I know ASCII is...

## Count lines in ASCII file using C

c,ascii,text-files
I would like to count the number of lines in an ASCII text file. I thought the best way to do this would be by counting the newlines in the file: for (int c = fgetc(fp); c != EOF; c = fgetc(fp)) { /* Count word line endings. */ if...

## troubles with understanding how ASCII works

encoding,byte,ascii,bit
I have few questions about ASCII encoding: How come there is 127 characters definable in ASCII coding? It should be 7-bit, which means 2 to the power of 7 which equals 128. Where is the one character missing? When I save a textfile as a textfile.txt it should be saved...

## Best way to Convert pairs of base 10 integers to ascii characters in python

python,python-2.7,ascii
I am talking to a piece of a test equipment using a serial interface. The two letter ascii ID of the device is encoded as a base 10 integer in a specific register. Each pair of integers needs to be converted to an ascii character. My question is what is...

## changing letter into an encryption in java. simple call

java,syntax,ascii
What is the other way to change "a" to e.g."\n65" or other call in java which is based on ascii? this is not taught to java developers anymore but it was nice to know. i just forgot, but i need to use it for our project

## Java KeyEvent.getKeyCode() return a virtual key or ASCII?

java,input,keyboard,ascii
I want to create an array of all keys on the keyboard. How many KeyCode are they ? KeyEvent.getKeyCode() return ASCII or Virtual Key?...

## Convert ASCII file to Decimal file

c#,file,decimal,ascii
Hello I have a textfile with (ASCII or other format i don't know maybe UTF or UNICODE) text. In this file are special letters. I want to convert all letters, the complete file into DECIMAL. I just don't know how. private void simpleButton1_Click(object sender, EventArgs e) { int size =...

## Convert Binary File To String In Perl

perl,binary,hex,ascii
Ok. I have spent the last 14 hours trying to figure this out. I have a binary file with the following contents - (much more, but this is truncated version). I wish to convert this to readable string format. ^@^P<9A>^@^@^A^@^@И^@^@^A^@^@Κ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^F<9A>^@^@^@^@^@^@^C^@FQ]U:^@^M^@...

## Matching extended ASCII characters in .NET Regex

c#,regex,ascii,extended-ascii
I'm writing a .NET regular expression that needs to match all ASCII and extended ASCII characters except for control characters. To do this, I consulted the ASCII table and it seems that all these characters have an ASCII encoding of x20 to xFF. So I suppose [\x20-\xFF] should be able...

## DOS ASCII Code pages

ascii,data-conversion,utf,ebcdic
I have a legacy system that is using one EBCDIC to ASCII conversion table. The writer probably did not know that there are multiple code pages for ASCII and EBCDIC. There are extended and accented letters that are not converted properly and I can fix those according to the code...