Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect Persian printing #1912

Closed
xubuntu4iran opened this issue Dec 6, 2013 · 12 comments
Closed

Incorrect Persian printing #1912

xubuntu4iran opened this issue Dec 6, 2013 · 12 comments

Comments

@xubuntu4iran
Copy link

@xubuntu4iran xubuntu4iran commented Dec 6, 2013

youtube-dl --proxy "" http://www.aparat.com/zoomit
WARNING: Falling back on generic information extractor.
[generic] zoomit: Downloading webpage
[generic] zoomit: Extracting information
[download] Destination: آپارات - ویدیو های زومیت - دنیای فناوری-769161767b46fbc3bb39117fe79ac7f0856021.apt
[download]   1.0% of 12.22MiB at 42.86KiB/s ETA 04:49^C
ERROR: Interrupted by user

There is a program for terminal named fribidi, is it possible to impelement that to print correctly 5th line?

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Dec 6, 2013

Could you please explain the exact problem for non-persian speakers?

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Dec 6, 2013

When using iTerm2 on OSX I see this:
iterm
But if I try to copy it or see your report in firefox I see the text in the opposite direction:
firefox
Which is the correct one? and which is the one you get?

@xubuntu4iran
Copy link
Author

@xubuntu4iran xubuntu4iran commented Dec 6, 2013

Because Persian is right to left language, while English is left to right and some letters join together in words, while terminal behave it like a left to right language and doesn't join those some letters, in terminal I use fribidi to correct this problem,
when i echo "سلام دنیا", Terminal prints incorrectly, but when I echo "سلام دنیا"|fribidi, it prints correctly

@phihag
Copy link
Contributor

@phihag phihag commented Dec 8, 2013

This feels like it's the responsibility of the terminal and not the application.

@xubuntu4iran
Copy link
Author

@xubuntu4iran xubuntu4iran commented Dec 8, 2013

When terminal does not this work, why should not program do this work?!

@phihag phihag closed this in 0783b09 Dec 9, 2013
@phihag
Copy link
Contributor

@phihag phihag commented Dec 9, 2013

In general, we cannot detect bidi functionality in the terminal. youtube-dl 2013.09.12.1 and newer contain an option --bidi-workaround though, which will pipe our output through the fribidi executable. You can make that option permanent by including it in your configuration file. Note that fribidi does not seem to support ungetting (partial lines), we must emit newlines for status output.

@xubuntu4iran
Copy link
Author

@xubuntu4iran xubuntu4iran commented Dec 9, 2013

Great thanks to Phihag!

@xubuntu4iran
Copy link
Author

@xubuntu4iran xubuntu4iran commented Dec 9, 2013

This is not a good support:

youtube-dl --proxy "" http://www.aparat.com/v/teYF2
WARNING: Falling back on generic information extractor.
[generic] teYF2: Downloading webpage
[generic] teYF2: Extracting information
[download] Destination: حلقه هوشمند برای کنترل تلفن-cc8ea41f89ccbcdcec29ead49651
01d6859928.apt
[download]   0.0% of 2.61MiB at 548.20KiB/s ETA 00:04
[download]   0.1% of 2.61MiB at 599.64KiB/s ETA 00:04
[download]   0.3% of 2.61MiB at 36.77KiB/s ETA 01:12
[download]   0.6% of 2.61MiB at 75.73KiB/s ETA 00:35
[download]   1.2% of 2.61MiB at 24.84KiB/s ETA 01:46
[download]   1.7% of 2.61MiB at 20.68KiB/s ETA 02:06

Program prints correctly lines included Persian words, but prints percentage line repeatedly!

@phihag
Copy link
Contributor

@phihag phihag commented Dec 9, 2013

I enabled that option because fribidi does not support the line removing (or more precisely, partial lines in the first place). I just rewrote the support to use a different approach that's more complicated, but does not have tihs downside. Update to youtube-dl 2013.12.09.2 to test it.

@xubuntu4iran
Copy link
Author

@xubuntu4iran xubuntu4iran commented Dec 9, 2013

Thank you, this is better.

@xubuntu4iran
Copy link
Author

@xubuntu4iran xubuntu4iran commented Dec 20, 2013

@phihag I think fribidi has problem with long lines while bidiv doesn't have this problem, but bidiv has problem with half-distance, I suggest you to replace fribidi with bidiv.

@phihag
Copy link
Contributor

@phihag phihag commented Dec 20, 2013

@xubuntu4iran Can you post a test case describing how it should look? And I'd rather fix the problem with long lines than incur yet another problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.