FAQ Database Discussion Community

## Normalise ASCII numbers to digit numbers

ascii,rust,bytestring
Running example: http://is.gd/NBpvmH fn main() { show({ let number = b"123456"; for sequence in number.windows(6) { let product = sequence.iter().fold(1, |a, &b| a * (b as u64)); println!("product of {:?} is {}", sequence, product); } }); } Instead of having an output like "product of [49, 50, 51, 52, 53,...

## Combine std::wstring and function

c++,string,ascii,sfml,wstring
I'm creating text in SFML 2.1 (It doesn't really matter) in c++. Setting a text string looks like that: text.setString("something"); Ok, but because my game language is Polish, I have to enter some characters like ą,ż,ł,ś,ć etc. , which are not 'supported' in my game's ASCII encoding. Iv'e came up...

## 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

## Examining ASCII

c,gdb,ascii
How can I get the ASCII representation of hexadecimal values in the memory by examining in gdb? The gdb command x/[repeatCount] [memoryAddress] gives me hexadecimal 32-bit values starting at memoryAddress repeatCount times but I want the readable text/String which is represented by this data. How do I do that? This...

## 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...

## 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;...

## 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:...

## php split string every

php,string,ascii,explode
I have a txt file with ascii data which need to be converted into multiple strings. I already converted. Now what i don't know how to do is to cut every 63 times that the ";" appears. CODE: This is what i have done. to concert the file to a...

## How do i store an (int)string into an int array

c++,arrays,string,ascii
int ascii[1000] = {0}; string *data = (string*)malloc ( 1000*sizeof( string)); char *text = (char*)malloc ( 1000 *sizeof( char)); cout << "Enter the first arrangement of data." << endl; cin.getline(text, 1000); char *token = strtok(text, " "); while ( token != NULL ) { if ( strlen(token) > 0) {...

## 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...

## 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....

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

jquery,ascii,keypress,backspace

## Program that outputs a pattern that looks like the union jack given the size

java,ascii
so my program is supposed to output a pattern like the union jack for ex: 3 = , 7 = 0X0 0 X 0 XXX 0 X 0 0X0 0X0 XXXXXXX 0X0 0 X 0 0 X 0 here is my code so far... can someone find what is wrong?...

## What is a code point and code space?

character-encoding,character,ascii
I was reading the Wikipedia article on code points, but not sure if I understand correctly. For example, the character encoding scheme ASCII comprises 128 code points in the range 0hex to 7Fhex So is 0hex a code point? Also could not find anything on code space. PS. If it's...

## Remove '^@' line from a file

sed,ascii,binaryfiles,nano
I have a file in which I have a particular line of this type: ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^ ... Actually all the others lines are a list (a matrix) of numbers or *******. The problem is that I can not be able to open this file with normal editors and so I can...

## Unserialize objects from in-memory ASCII instead of from a file connection

json,r,serialization,ascii
Actual question How can I serialize objects to ASCII and unserialize them again from ASCII without having to write to and read from a file connection (i.e. from ASCII that is in-memory)? Background In a state-less client-server framework, I would like to make certain information persistent accross calls (serialize >>...

## Python - How can I change bytes in a file

python,unicode,binary,ascii,encode
I'm making a encryption program and i need to open file in binary mode to access non-ascii and non-printable characters, i need to check if character from a file is letter, number, symbol or unprintable character. That means i have to check 1 by 1 if bytes (when they are...

## Turn an ascii character code to a value between 0-26

algorithm,language-agnostic,ascii
Hello everyone today I have a question concerning the math involved in turning ascii code into a value between 0-26. With lowercase letters it's simply the characters code - 65. However if I run into capital letters it's no longer the case. I was wondering what would be the algorithm...

## In VBA, find n such that Chr(n) is greater than or equal to

vba,ascii,chr
Is there an n such that Chr(n) in Word VBA gives the greater than or equal to sign? Like Chr(150) is an m-dash (subtraction sign)?

## 1 Token is not getting stored in my array

arrays,parsing,ascii,stringtokenizer
#include <iostream> #include<string.h> #include<cstring> #include<ctype.h> using namespace std; char *Data1[100]; char *operators[20]; char *identifiers[20][20]; int *ascii[100] = {0}; int ascii2[100] = {0}; unsigned int Tcount = 0; unsigned int i; int main(void) { char *text = (char*)malloc ( 100 *sizeof( char)); cout << "Enter the first arrangement of data." <<...

## Convert UTF-8 Unicode string to ASCII Unicode escaped String

java,string,unicode,utf-8,ascii
I need to convert unicode string to string which have non-ascii characters encoded in unicode. For example, string "漢字 Max" should be presented as "\u6F22\u5B57 Max". What I have tried: Differenct combinations of new String(sourceString.getBytes(encoding1), encoding2) Apache StringEscapeUtils which escapes also ascii chars like double-quote StringEscapeUtils.escapeJava(source) Is there an easy...

## 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. ...

## 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^@...

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

php,email,utf-8,ascii,imap

## convert list that represent binary string into ASCII C#

c#,list,char,ascii
I have a list of chars that represents a binary string. List<char> myCharList = new List<char>(); For example, the charList holds the ascii H which represented by the binary sequence: 01001000 I try to convert this List into ASCII so I can show it in a Text Block. Thanks ...

## Python: changing string values in lists into ascii values using append

python,ascii,ord
Im trying to figure out how to produce a list (for each string), a list of ASCII values representing the characters in each of those strings. EG. changing "hello", "world" so that it looks like: [[104, 101, 108, 108, 111], [119, 111, 114, 108, 100]] Heres my code so far:...

## hex to string chinese,chinese hex 2 byte ,english hex 1byte?

java,string,hex,ascii
this is stringToHexAsciiString. //将字符串转成ASCII十六进制的java方法 public static String stringToHexAsciiString(String value) { StringBuffer sbu = new StringBuffer(); char[] chars = value.toCharArray(); for (int i = 0; i < chars.length; i++) { sbu.append(Integer.toHexString(chars[i])); } return sbu.toString(); } this is asciiToString begin //将ASCII转成字符串的java方法 public static String asciiToString(String value) { StringBuffer sbu = new StringBuffer();...

## 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...

## Building a code for ASCII to binary vice versa in C++ and running into a weird error

c++,string,binary,ascii
I'm building a program to convert ASCII to binary and then binary to ASCII. I've made something so far and the logic seems sound but am running into a error every time I try to compile it. The error is "Binary_reverse' was not declared in this scope". I've tried searching...

## Conversion to ASCII

ascii,lexical-analysis
#include <iostream> #include<string.h> #include<cstring> #include<ctype.h> using namespace std; char *Data1[100]; char *operators[20]; char *identifiers[20][20]; int ascii[100] = {0}; int ascii2[100] = {0}; unsigned int Tcount = 0; unsigned int i; int main(void) { char *text = (char*)malloc ( 100 *sizeof( char)); cout << "Enter the first arrangement of data." <<...

## What base is ASCII?

javascript,ascii
I'm trying to make a small JavaScript program where the user inputs a decimal value, and that value is converted to ASCII and given back to the user. I need to find out what base ASCII is so I can type: (User's input).toString(ASCII's base); Thank you....

## 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...

## RSA on ASCII message problems with '\0'

encryption,ascii,rsa,null-character
I want to encrypt and decrypt ASCII messages using an RSA algorithm written in assembly. I read that for security and efficiency reasons the encryption is normally not called character-wise but a number of characters is grouped and encrypted together (e.g. wikipedia says that 3 chars are grouped). Let us...

## 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?...

## 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...

## 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...

## █ character string indexed in python

python,string,unicode,ascii,python-2.x
I'm trying to get the index of 'J' in a string that is similar to myString = "███ ███ J ██" so I use myString.find('J') but it returns a really high value and if I replace '█' by 'M' or another character of the alphabet I get a lower value....

## 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...