Skip to main content
Filter by
Sorted by
Tagged with
1083 votes
31 answers
2.7m views

It seems there are different ways to read and write data of files in Java. I want to read ASCII data from a file. What are the possible ways and their differences?
Tim the Enchanter's user avatar
294 votes
11 answers
492k views

What is ANSI encoding format? Is it a system default format? In what way does it differ from ASCII?
web dunia's user avatar
  • 10k
147 votes
10 answers
22k views

I was solving some problem on codeforces. Normally I first check if the character is upper or lower English letter then subtract or add 32 to convert it to the corresponding letter. But I found ...
Devon 's user avatar
  • 1,263
215 votes
18 answers
327k views

I imagine I need to remove chars 0-31 and 127. Is there a function or piece of code to do this efficiently?
Stewart Robinson's user avatar
334 votes
12 answers
314k views

I need to replace all non-ASCII (\x00-\x7F) characters with a space. I'm surprised that this is not dead-easy in Python, unless I'm missing something. The following function simply removes all non-...
dotancohen's user avatar
  • 31.8k
205 votes
12 answers
548k views

My code just scrapes a web page, then converts it to Unicode. html = urllib.urlopen(link).read() html.encode("utf8","ignore") self.response.out.write(html) But I get a UnicodeDecodeError: Traceback (...
themirror's user avatar
  • 10.3k
269 votes
15 answers
304k views

I want to I check whether a string is in ASCII or not. I am aware of ord(), however when I try ord('é'), I have TypeError: ord() expected a character, but string of length 2 found. I understood it is ...
Nico's user avatar
  • 2,719
421 votes
2 answers
376k views

What is the difference between the Unicode, UTF8, UTF7, UTF16, UTF32, ASCII, and ANSI encodings? In what way are these helpful for programmers?
web dunia's user avatar
  • 10k
112 votes
9 answers
231k views

What is the regex to match xxx[any ASCII character here, spaces included]+xxx? I am trying xxx[(\w)(\W)(\s)]+xxx, but it doesn't seem to work.
ion's user avatar
  • 1,251
99 votes
13 answers
127k views

I'm looking for a way to pretty-print tables like this: ======================= | column 1 | column 2 | ======================= | value1 | value2 | | value3 | value4 | ======================= ...
kdt's user avatar
  • 28.6k
2 votes
4 answers
59k views

I have a problem with my assembly code. I want to print number stored in register cx, but when i tried to print it, it printed ascii character instead of ascii number, so I decided to write a ...
aron23's user avatar
  • 423
56 votes
4 answers
39k views

Any thoughts on why this isn't working? I really thought 'ignore' would do the right thing. >>> 'add \x93Monitoring\x93 to list '.encode('latin-1','ignore') Traceback (most recent call last)...
Greg's user avatar
  • 47.5k
224 votes
10 answers
216k views

On Linux, I have a directory with lots of files. Some of them have non-ASCII characters, but they are all valid UTF-8. One program has a bug that prevents it working with non-ASCII filenames, and I ...
Amandasaurus's user avatar
  • 61.3k
98 votes
11 answers
489k views

I have int i = 6; and I want char c = '6' by conversion. Any simple way to suggest? EDIT: also i need to generate a random number, and convert to a char, then add a '.txt' and access it in an ...
user963241's user avatar
  • 7,128
121 votes
13 answers
197k views

Character to value works: $ printf "%d\n" \'A 65 $ I have two questions, the first one is most important: How do I take 65 and turn it into A? \'A converts an ASCII character to its value using ...
user avatar
461 votes
16 answers
172k views

Wikipedia says Base64 encoding schemes are commonly used when there is a need to encode binary data that needs be stored and transferred over media that are designed to deal with textual data. This ...
Lazer's user avatar
  • 95.9k
49 votes
1 answer
39k views

I have a problem displaying non-ASCII characters in Matplotlib, these characters are rendered as small boxes instead of a proper font, it looks like (I filled these boxes with red paint to hightlight ...
jb.'s user avatar
  • 24.1k
82 votes
5 answers
59k views

I've got a bunch of csv files that I'm reading into R and including in a package/data folder in .rdata format. Unfortunately the non-ASCII characters in the data fail the check. The tools package has ...
Maiasaura's user avatar
  • 33.1k
203 votes
9 answers
667k views

How can I convert from hex to plain ASCII in Python? Note that, for example, I want to convert "0x7061756c" to "paul".
Paul Reiners's user avatar
  • 7,944
89 votes
1 answer
30k views

What is the difference in calling the Win32 API function that have an A character appended to the end as opposed to the W character. I know it means ASCII and WIDE CHARACTER or Unicode, but what is ...
Questionaire's user avatar
173 votes
10 answers
164k views

If UTF-8 is 8 bits, does it not mean that there can be only maximum of 256 different characters? The first 128 code points are the same as in ASCII. But it says UTF-8 can support up to million of ...
eMRe's user avatar
  • 3,267
1 vote
3 answers
3k views

I have 100 ASCII files in my directory all named as follows: int_001.ASC int_002.ASC int_003.ASC . . . int_099.ASC int_100.ASC I have to import them in MATLAB all with importdata, ...
ragnar's user avatar
  • 57
42 votes
3 answers
121k views

I am trying to find the values that my local system assigns to the arrow keys, specifically in Python. I am using the following script to do this: import sys,tty,termios class _Getch: def ...
Newb's user avatar
  • 2,940
8 votes
3 answers
144k views

I am trying to convert a character to its binary representation (so character --> ascii hex --> binary). I know to do that I need to shift and AND. However, my code is not working for some reason. ...
darksky's user avatar
  • 21.2k
53 votes
9 answers
98k views

I downloaded a webpage in my python script. In most cases, this works fine. However, this one had a response header: GZIP encoding, and when I tried to print the source code of this web page, it had ...
TIMEX's user avatar
  • 275k

1
2 3 4 5
17