Timeline for Mac Terminal does not display U+200C Unicode special character correctly
Current License: CC BY-SA 4.0
16 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 20 at 3:48 | vote | accept | Mehrshad Khansarian | ||
Oct 20 at 2:45 | comment | added | Mehrshad Khansarian | @LincDavis, thank you very much. I had been unaware of the webpage you shared. It was quite helpful. | |
Oct 19 at 16:36 | comment | added | Andy Griffiths | @MarcWilson Very good point. Didn't consider that and suppose it answers OP too. | |
Oct 19 at 15:36 | answer | added | Marc Wilson | timeline score: 2 | |
Oct 19 at 15:24 | comment | added | Marc Wilson | @AndyGriffiths That's more like the line editor in whatever shell you're using not knowing what to do with it when you type it. But it gets assigned to the variable correctly and when the terminal outputs it, it's the right glyph. | |
Oct 18 at 21:55 | comment | added | Linc Davis | Maybe you would find something here: github.com/vimpersian/vimpersian.github.io | |
Oct 18 at 21:03 | comment | added | Mehrshad Khansarian |
The thing is, I encountered this problem when trying to edit a file in Vim that included U+200C . Apparently, it wasn't displayed correctly. I had set everything in Vim to UTF-8 and even enabled bidirectional text (as Persian is right-to-left). Everything looked perfect except for <200c> . I realized the terminal is somewhat incapable of displaying it. That's the problem I'm trying to solve.
|
|
Oct 18 at 21:00 | comment | added | Mehrshad Khansarian | I tried iTerm 2 as well, and the result is same as yours. | |
Oct 18 at 20:47 | comment | added | Linc Davis | I don't know that you can, but is that really a problem? | |
Oct 18 at 20:37 | comment | added | Andy Griffiths | Like you both, (UTF-8 enabled) directly pasting the characters I get the wrong output, but assigning to a variable, it's shown correctly as per OP's example above when echoed. Interestingly I also tried using iTerm and while a straightforward paste also shows `<200c>, the character order looks different. Also assigning to a variable in iTerm 'works' but the 'correct' output isn't in the correct order again. OP, might you experiment with iTerm as well and see if that offers a new perspective on what may be happening? | |
Oct 18 at 20:34 | comment | added | Mehrshad Khansarian |
To be more specific, I see this at first: str='می<200c>روم' , but when I run echo $str , it correctly displays: میروم . How can I get it to display correctly in the first place?
|
|
Oct 18 at 20:27 | history | edited | Mehrshad Khansarian | CC BY-SA 4.0 |
Add source(s)
|
Oct 18 at 20:25 | comment | added | Mehrshad Khansarian | Strangely enough, I get the right output. | |
Oct 18 at 19:55 | comment | added | Linc Davis | If I assign that string to a variable and then echo the variable, I get what looks like the right output. Is that what you're doing? | |
S Oct 18 at 19:30 | review | First questions | |||
Oct 18 at 19:39 | |||||
S Oct 18 at 19:30 | history | asked | Mehrshad Khansarian | CC BY-SA 4.0 |