Aug-15-2018, 05:34 AM
is this character printable?
i found a place where Python is making this decision, probably from a Unicode database. the repr() function, when given a raw character that cannot be printed, returns a string with an octal escape sequence for the code point value of that character. but if it is printable, it returns the same raw character. in both cases it puts single quotes before and after what it has decided to return.
this can be used to decide to print, or not, various Unicode characters. the way i do it is to check the length repr() returns for each single character. so i do code like
i found a place where Python is making this decision, probably from a Unicode database. the repr() function, when given a raw character that cannot be printed, returns a string with an octal escape sequence for the code point value of that character. but if it is printable, it returns the same raw character. in both cases it puts single quotes before and after what it has decided to return.
this can be used to decide to print, or not, various Unicode characters. the way i do it is to check the length repr() returns for each single character. so i do code like
len(repr(ch))<4
to make the decision to print the character or a blank in its place,
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.