FAQ Database Discussion Community


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

How to put anise code in a string(there is single " and ' in ascii code)?

c++,xcode,ascii
Here is the part: const string{ !"#$%&'()*+,-./0123456789:;<=>[email protected][\]^_`abcdefghijklmnopqrstuvwxyz{|}~}; With a " and ', the complier thinks is an another string....

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

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

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

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

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

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 -/\() ...

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

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

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

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

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

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

Python-like Byte Array String representation in C#

c#,escaping,bytearray,ascii
Here is the method I am using to get this string representation: public static string ByteArrayToString(byte[] ba, string prefix) { StringBuilder hex = new StringBuilder(ba.Length * 2); foreach (byte b in ba) { if (prefix != null) { hex.Append(prefix); } hex.AppendFormat("{0:x2}", b); } return hex.ToString(); } Here is a sample...

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

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

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

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

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

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

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

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

BeautifulSoup ascii error and csv

python,csv,beautifulsoup,ascii
I have read all of the posts on the error, and still cannot figure out how to debug my specific issue. From the command line, I am reading in a csv file. adamg:NLP adamg$ python3 train_classifier.py samples.csv /Users/adamg/PycharmProjects/NLP/samples If I open it as a byte file, like so: training_pages_list_file =...

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

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

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

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

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

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

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

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

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

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

regex doesnt match the line starts with character e

regex,node.js,ascii
I have such a regex: /^[^(\-.+\n|content|\n\-.+\-{2})](.+)/igm This is a sample input: ------WebKitFormBoundaryKanSEkvcMamqayJY Content-Disposition: form-data; name="fl"; filename="emty" Content-Type: application/octet-stream this is trial ------WebKitFormBoundaryKanSEkvcMamqayJY-- I want to capture every line except those below: ------WebKitFormBoundaryKanSEkvcMamqayJY Content-Disposition: form-data; name="fl"; filename="emty" Content-Type: application/octet-stream ------WebKitFormBoundaryKanSEkvcMamqayJY-- This regex works well unless...

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

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

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.

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

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

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

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

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

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

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

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

Java Conversion from ASCII Integer to Character yields unknown values

java,char,type-conversion,ascii
I have some Java code that should be very simple and straightforward, and unfortunately, I'm getting very odd results. Put simply, I'm doing a basic conversion from ASCII integers back into their string values. For instance, if I do: char n = (char) 152; System.out.print(n); // should yield: ÿ. Unfortunately,...

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

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

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

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

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 ascii / 7bit email to utf8?

php,email,utf-8,ascii,imap
I read e-mails via php imap, and I can convert the header data to utf8. But some email body is in ascii / 7bit, and I can't convert it. No change by iconv($row['encode'],'utf-8' ,$row['text']); or mb_convert_encoding($row['text'], $row['encode'], "UTF-8"); and imap_utf8($row['text']); fails. Do you have any idea to get off the...

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

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

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

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

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

Conversion from char to int and printing the decimal value

c,char,printf,decimal,ascii
char str[20]; printf("Enter anything\n"); scanf("%s",str); for(int i = 0 ; i<strlen(str) ; i++) { if( isdigit(str[i])) printf("%d",(int)str[i]); } I tried with the above code but the output is in ASCII values of the numbers rather then actual numbers. Like , input: "0" output: "48". When I try (int)(str[i]-'0'); instead of...

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

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

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

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

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

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

convert ASCII character array to UNICODE string

c#,c,user-interface,unicode,ascii
I am calling a c dll function in c# which returns a 64 bit ASCII character array, since c# uses UNICODE how do I convert the ASCII character array to a UNICODE string? I have done this before by having the string in a struct because the function had a...

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

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

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

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

jquery,ascii,keypress,backspace
I've got this jQuery: $(document).on("keypress", '[id*=Float]', function (e) { //only allow 1..9 (48..57), '.' (46), and backspace (8) var k = e.which; if (k === 8 || k === 46) return; if (k < 48 || k > 57) { e.preventDefault(); } }); ...working on this HTML: <input type="text" id="txtbxFloat">...

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

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

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

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

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

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

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

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

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

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

Traceback from a Python Script: invalid literal

python,ascii,traceback
In short, what the Python script is supposed to do is to load and calculate ASCII type files. With some previously pre-processed files, it works without errors, while with mine it throws an error. In any case, it looks as though my file is different from what it should be...

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

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

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

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