T
T
tytar2017-01-05 11:35:15
Python
tytar, 2017-01-05 11:35:15

How to transcode special characters characters in python?

Good afternoon, there is a dict in which characters like
complex_consonant = {
"d̑z'": 'd͡zʲ',
"n':": 'ɲː',
"d':": 'ɟː',
"t':": 'cː'
}
How to correctly recode it into a format like {u"\u1D49" : u"\u1D49"} and then save it in the same format?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sly_tom_cat ., 2017-01-05
@Sly_tom_cat

What for?
If this is the 3rd python, then everything inside it is already in Unicode. And the u"\uXXXX" format is just a text representation format.
The second one is a little more difficult - but it's better not to use the second one if you need Unicode - in the second it's a bit complicated ...

S
Stepan Krapivin, 2017-01-15
@xevin

there should be no difficulties with the second python if you add imports to the beginning of the file,
all lines will become unicode

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question