chr() is a function in Python or PHP which returns the character (string of length one) that corresponds to an ASCII code point.
Questions tagged [chr]
166 questions
1
vote
1 answer
UnicodeEncodeError in python3.4.2?
Hi i have the following code in python3.4.2:
s='416f1c7918f83a4f1922d86df5e78348'; w="0123456789abcdef"; x=''.join([chr(w.index(s[i])*16+w.index(s[i+1])) if(i%2==0) else '' for i in range(len(s))]); print(x);
and it shows this…

Sumanto Dinar
- 87
- 8
1
vote
3 answers
How to return an array of characters in cypher program (python3)
i wrote code when input for example is "a" he return "h". But how i can make it work if i want to return array of characters, for example if is input "aa"
to return "hh"?
def input(s):
for i in range(len(s)):
ci = (ord(s[i])-90)%26+97
…

Stefan Simić
- 31
- 7
1
vote
1 answer
Hex to ascii conversion error in Excel VBA
I have found below stated function for conversion of hex to text.It works fin for most of hex to text conversions but give abnormal result.
For example, hex value is:…

vinay agarwal
- 53
- 1
- 2
- 8
1
vote
1 answer
How can I use the "chr" and "ord" command to decipher a message that a user has input?
I am able to encode the message using the ASCII table but unfortunately I am unable to decode the message. After the user the gets the result he/she will type either yes or no to redo the message to the original input. Thanks!
def main():
…
user5982655
1
vote
1 answer
Why CHR(157) is used in oracle?
I am not understanding why CHR(157) is used code of ORACLE. When I executed below code i got output as 'HELLO WORLD!'
SELECT 'HELLO' || CHR(157) || ' WORLD!' FROM DUAL;
Some of editors don't display the CHR(157) value. Please let me know if anybody…

Devashri B.
- 2,593
- 8
- 25
- 39
1
vote
2 answers
Informix Server 10 and remove CR character in select
I need to remove the CR character in a select in Informix Server 10.
The function chr doesn't exist in version 10, so when I try a replace like that
REPLACE(text_column, chr(10), ' ')
I get an error like that:
Routine (chr) can not be resolved.…

Realshit
- 13
- 1
- 3
1
vote
3 answers
Why `print '1\x08'` results 1 meanwhile `print '1\x082'` results 2?
Today, I'm learning the built-in function chr. And through ascii-table search, I found \x08 means backspace. So I played a bit with it. But the result confused me:
In [52]: print '1\x08'
1
In [53]: print '1\x082'
2
It seems that only follow by…

Zen
- 4,381
- 5
- 29
- 56
1
vote
2 answers
1
vote
1 answer
ORD and CHR a file in Bash
I build ord and chr functions and they work just fine.
But if I take a file that contains \n, for example:
hello
CHECK THIS HIT
YES
when I ord everything I don't get any new line values. Why is that? I'm writing in Bash.
Here is the code that I am…

JhonaBona99
- 33
- 1
- 4
1
vote
2 answers
.Net using Chr() to parse text
I'm building a simple client-server chat system.
The clients send data to the server and the server resends the data to all the other clients. I'm using the TcpListener and Network stream classes to send the data between the client and the…

Marcx
- 6,806
- 5
- 46
- 69
1
vote
2 answers
display ASCII data in ColdFusion from a parameter
I have set up a language file rather than in the database, so I have for example in the language file…
So I have in my cfm page…
#lang_back_to_results#
This works fine…

elixireu
- 255
- 3
- 15
1
vote
1 answer
Splitting a dataframe based in a column
I would like to split my data.frame depending of a column tagged as "Chr". I would like to write these splitted objects in a .txt file automatically too.
My input:
Name Chr Position LTR
Prob1 1 55 0.2
Prob2 2 25 0.9
Prob3 3 …

user3091668
- 2,230
- 6
- 25
- 42
1
vote
4 answers
How do I convert a list of numbers into their corresponding chr()
c = list(range(97, 121))
If I print this it will give
[97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119]
Each of these number's chr() is string(alphabet) but how do I convert this list…

user3382238
- 143
- 1
- 2
- 11
1
vote
3 answers
Perl, substitute hexa text by the corresponding chr-ed character
I have a file which contains long lines made of text mixed with encoded character.
%255D%252C%2522actualPage%2522%253A1%252C%2522rowPerPage%2522%253A50%257D%255D
Each encoder character is %25xx where xx is the hexa value of the ascii char (ex.…

Peyre
- 397
- 2
- 14
1
vote
2 answers
MS Access 2007 VBA: validating text field with VBA and Chr()
I am trying to validate entry of a form field using the following VBA. This works very well. My problem is this Access app creates a variety of XML data files, and I don't want certain characters within that xml....namely soft-returns (Shift+Enter).…

Justin
- 4,461
- 22
- 87
- 152