Questions tagged [non-ascii-characters]

ASCII stands for 'American Standard Code for Information Interchange'. ASCII is a character-encoding scheme based on the ordering of the English alphabet. Since ASCII only contains definitions for 128 characters, numerous other encoding schemes have been created to include characters from other alphabets and other symbols.

1055 questions
3
votes
2 answers

N-curses within Python : how to catch and print non ascii character?

I want to make a small program with ncurses/python and to be able to use/type in french and japanese. I understand that I should set the locale and use unicode standard. But how to deal with the result from screen.getch() ? I would like to display…
3
votes
1 answer

My flask app doesn't return non-ascii character properly

I am trying to use flask-restful api, and as a returning value the code should returning a list of json datas. However, when contents in json is non-ascii character like (èòsèèò) the returning value This is the a sample code: #! /usr/bin/env…
3
votes
0 answers

SyntaxError: Non-ASCII character '\xc2' in file, but no encoding declared in Python 2.7

I'm working on a sentiment analysis program, it was working properly on a windows (python 3.4) but when I switched to a mac os (python 2.7) it gave me this error when i ran it: SyntaxError: Non-ASCII character '\xc2' in file ./twitter.py on line…
3
votes
2 answers

Why do we use string.charAt(index)-'a' in java?

public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); int[] arr = new int[26]; for(int i=0;i
psygo
  • 95
  • 2
  • 10
3
votes
1 answer

Non-ASCII characters in python 2 shebang

As PEP 263 says, Python 2 (specifically 2.7 in my case) requires a magic comment line to specify a file encoding: # -*- coding: utf-8 -*- Without that it is not possible to include non-ASCII characters in the file. A notorious error would be…
Glutexo
  • 547
  • 6
  • 13
3
votes
5 answers

Your SDK location contains non-ASCII characters - no Android in Tools Menu

I've just downloaded and installed Android Studio but there is no Android submenu in Tools menu and no AVD Manager icon on the instrument panel. When I start SDK Manager, there is an error message: Please specify a Android SDK location SDK…
3
votes
2 answers

Why does US-ASCII encoding accept non US-ASCII characters?

Consider the following code: public class ReadingTest { public void readAndPrint(String usingEncoding) throws Exception { ByteArrayInputStream bais = new ByteArrayInputStream(new byte[]{(byte) 0xC2, (byte) 0xB5}); // 'micro' sign UTF-8…
Grzegorz Oledzki
  • 23,614
  • 16
  • 68
  • 106
3
votes
1 answer

How to work with non-ascii characters in strings in C++?

When writing a program, I'm having issues working with a combination of special characters and regular ones. When I print either type to the console separately, they work fine, but when I print a special and normal character in the same line, it…
The_Fireplace
  • 43
  • 1
  • 6
3
votes
2 answers

How to include Non-ascii characters in regular expression in Python

I have a text file, which I'm reading line by line. In each line, if there are special characters, then I'm removing the special characters, for this, I'm using the help of regular expressions. fh = open(r"abc.txt","r+") data = fh.read() …
Mridul Sachan
  • 93
  • 1
  • 2
  • 11
3
votes
0 answers

R regex for control ascii characters

I want to detect the presence of ASCII control characters in my text file , excluding the control characters CR and LF i am trying grepl("[\x01-\x09\x11-\x12\x14-\x1F\x7F]",file$text) where a sample file text looks like but when i run the above…
shashankp
  • 63
  • 1
  • 7
3
votes
2 answers

pandas.read_csv can't import file with accent mark in path

I am developing an application with Python and a QT GUI. I need to import a file to a DataFrame. I use a QFileDialog.getOpenFileName to get the path and filename to open it with pandas.read_csv method. Everything works well until I get a path with…
jmejias
  • 138
  • 10
3
votes
0 answers

str_ireplace() does not catch uppercase in Cyrillic script

I am using this function to color all the matches in my search. It works on lowercase words, in Cyrillic script, like "search" but not with "Search". The function: public function highlight($text='', $word='') { if(strlen($text) > 0 &&…
Toma Tomov
  • 1,476
  • 19
  • 55
3
votes
2 answers

Bash/Linux Find non-ASCII character in a .txt file and replace it with an ASCII character

I have a list of files offloaded from oceanographic instruments. For some reason, there is occasionally a non-ASCII character inserted where an ASCII character should be. I have found grave-E (È) where there should be a W to denote the western…
Connor Dibble
  • 517
  • 3
  • 13
3
votes
0 answers

C# SmtpClient Subject with French Accent

I'm trying to send Email for my app and i have "è" and "é" character in my email subject that need to be send (It's important to be with the accent) My vérification email is working "Bière - Vérification du email" and i receive it like that in my…
Vince
  • 1,279
  • 2
  • 20
  • 40
3
votes
1 answer

python3 print function emits 'ascii' codec can't encode character error

A user inputs a string on my website. They input a non-ascii character. The javascript saves their input, packages it with JSON.stringify(), and sends it to the server. The server, running Python3, unpacks the JSON with json.loads and saves this…
mareoraft
  • 3,474
  • 4
  • 26
  • 62