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

c++,xcode,ascii

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

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