FAQ Database Discussion Community

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

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

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

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

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

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

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

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

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

jquery,ascii,keypress,backspace

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

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

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

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

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

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

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

c++,xcode,ascii

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

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

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

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

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

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