FAQ Database Discussion Community

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

## Saving alphabet in array gets stack smashing error

c,char,ascii
This is a little simple program to save and show all the ASCII alphabet letters in an array: #include <stdio.h> int main(void) { int j = 0; char alpha[52]; for (i=65;i<=122;i++) { if (i<=90 || i>=97) { alpha[j] = i; } j++; } printf("\n"); return 0; } It gets the...

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

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

## How do I apply CSS style to ASCII character

html,css,styles,ascii,weight
I'd like to reduce the weight of a my ascii degree character &deg; in my html document. Does anybody know how? HTML: <html> <body> <table> <tr> <td> <div style="position:absolute; top: 70; right: 0;"> 72 <span>&deg;</span> F </div> </td> </tr> </table> </body> </html> CSS: body { height: 100%; font-weight: 400; color:...

## C: Reading a file to keep track of each extended ASCII appearance count

c,ascii
I am currently trying to read the count of each character in a file. The file is encrypted so it contains ascii values 0 to 255. My ultimate goal is to return the character that appeared the most. The Problem After reading through the file I print the array for...

## Encode an executable file

c++,encoding,ascii
I want to Encode and Decode an executable file The problem is about NULL The file content is MZ(NULL) so the binary code will be 01001101 01011010 00000000 The output should should be: 4d (for M -> 0100 1101) 5a(for Z -> 0101 1010) and 00(for NULL -> 0000 0000)...

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

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

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

## How to convert char ASCII to hex equivilent in C?

c,char,hex,ascii,lcd
So basically, I am writing code to control an LCD via a micro-controller. (atmega 32) I have the following in my main method: unsigned char str1[9] = "It Works!"; sendString(str1); and here is my sendString method: // Converts each char to hex and sends to LCD void sendString(unsigned char *string){...

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

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

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

php,email,utf-8,ascii,imap

## Why JDK8's Base64 uses ISO-8859-1?

character-encoding,base64,ascii,java-8,iso-8859-1
I'm writing my own BASE64 encoder/decoder for some constrained environments. And I found that Base64.Encoder#encodeString saying that it uses ISO-8859-1 for construct a String from those encoded bytes. I perfectly presuming that ISO-8859-1 charset also covers all base64 alphabets. Is there any possible reason not to use US-ASCII?...

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

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

## Binary to Ascii trouble with string builder (JAVA)

java,binary,ascii,stringbuilder
I have a string and I want to change it to binary but then later in the code I wish to change it back into ascci. How would I do that? Here is my code so far: String word = JOptionPane.showInputDialog("Insert word"); String s = word; byte[] bytes = s.getBytes();...

## ASCII files get erased after opening in Python [closed]

python,csv,ascii
I started learning Python recently and came across of the following problem I open a ASCII fine for reading, say data.txt and try to print it to the screen. I am using this code: f = open("E:\ASCII\data.txt", "r") for line in f: print(repr(line)) This shows nothing on the screen, and...

## ASCII Code for Uppercase/Capital R with a Tilde Character Above

ascii,stata
I am trying to get the equivalent of LaTeX's $\tilde R$ in a Stata graph axis label. I don't thinks there's a SMCL way of doing that, but it's possible to use ASCII characters. However, there does not seem to be an ASCII code for an uppercase/capital R with a...

## Oracle query to find string not containing characters

regex,oracle,ascii
What is an Oracle query that will return all records where the field mytable.myname contains any characters other than A-Z a-z 0-9 -/\() ...

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

## Caesar Cipher w/Frequency Analysis how to proceed next?

c++,vector,ascii,frequency-analysis,caesar-cipher
I understand this has been asked before and I somewhat have a grasp on how to compare frequency tables between cipher and English(this is the language I'm assuming its in for my program) but I'm unsure about how to get this into code. void frequencyUpdate(std::vector< std::vector< std::string> > &file, std::vector<int>...

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

## Need help asap!! Can't display a checkerboard with array using ascii table

c++,arrays,visual-studio-2013,ascii
Sorry I'm a newbie in c++. I have this homework and I can't display my checkerboard with a for loop! The board must look like the image below each case case 8 caracter on 4 colomn and 2 row: #include "iostream" #include "string" #include <conio.h> #include <time.h> const int up...

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

## how to put characters combination as constant command into iOS framework

ios,objective-c,unicode,frameworks,ascii
I am new to iOS programming. I am developing some SDK framework right now. I have a command with three characters: 'ESC' 'E' '1', I wanna combine those three characters to generate a NSString and put this NSString into framework. Therefore others can directly use this Constant in framework. Any...

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

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

## What does the “^@” mean in file?

c,gcc,ascii,control-characters
Code: int fd; fd = open("fruit", O_WRONLY); write(fd, "apple", sizeof("apple")); close(fd); I compile it with $gcc test.c -o test and run as$ ./test Then I open the fruit file, and I see the following in the file: apple^@ What does the ^@ mean?...

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

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

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

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

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

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

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

## Why extended ASCII (special) characters take 2 bytes to get stored?

c++,c++11,byte,ascii,behavior
ASCII ranging from 32 to 126 are printable. 127 is DEL and thereafter are considered the extended characters. To check, how are they stored in the std::string, I wrote a test program: int main () { string s; // ASCII s += "!"; // 33 s += "A"; // 65...

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

## Converting to ASCII with numbers above 128

python,python-3.x,ascii
Simple question, yet should be simple answer ^_^ Looked around and found nothing. I'm using python 3.4 and can convert numbers up to 128 with the print (chr(int)) method without trouble. 104 gives me "h", and 73 gives me "I". However, when I use numbers higher than 128, it gives...

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

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

## I am finding difficulties to solve an expression [closed]

c,variables,ascii
I am finding difficulties to solve an expression please help me to do so. Declare four variables of type char. Initialize one variable to ‘z’. Initialize the other variables to the ASCII integer value for ‘z’, the ASCII octal value for ‘z’, and the ASCII hexadecimal value for ‘z’....

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

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

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

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

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

## BeautifulSoup ascii error and csv

python,csv,beautifulsoup,ascii

## Matlab: Read textfile with a mix of floats, integers and strings in the same column

matlab,data,ascii
loading a well formatted and delimited text file in Matlab is relatively simple, but I struggle with a text file that I have to read in. Sadly I can not change the structure of the source file, so I have to deal with what I have. The basic file structure...

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

## Convert a String to binary sequence in C# with zero padding when not 8 bits of char

c#,string,character-encoding,char,ascii
I use this method which I saw in one of the questions to convert ascii to binary string: public string GetBits(string input) { StringBuilder sb = new StringBuilder(); foreach (byte b in ASCIIEncoding.UTF8.GetBytes(input)) { sb.Append(Convert.ToString(b, 2)); } return sb.ToString(); } But, If the input is something like the message bellow...

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

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

## ASC Visual Basic for Java

java,vb6,ascii,non-ascii-chars
I need a function on Java that do the same as ASC function on Visual Basic. I've had looking for it on internet, but I can't found the solution. The String that I have to know the codes was created on Visual Basic. It's according to ISO 8859-1 and Microsoft...