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

French accents not handled correctly in --write-info-json output #349

Closed
Strolls opened this issue May 21, 2012 · 1 comment
Closed

French accents not handled correctly in --write-info-json output #349

Strolls opened this issue May 21, 2012 · 1 comment

Comments

@Strolls
Copy link

@Strolls Strolls commented May 21, 2012

Compare with --get-description:

$ youtube-dl --skip-download --get-description http://www.youtube.com/watch?v=7hrTwMr2xSk
Valse de Jo Privat Sa Préférée. www.myspace.com/clementreboul
$ youtube-dl --skip-download --write-info-json http://www.youtube.com/watch?v=7hrTwMr2xSk
[youtube] Setting language
[youtube] 7hrTwMr2xSk: Downloading video webpage
[youtube] 7hrTwMr2xSk: Downloading video info webpage
[youtube] 7hrTwMr2xSk: Extracting video information
[info] Video description metadata as JSON to: 7hrTwMr2xSk.flv.info.json
$ cut -f 2 -d ',' 7hrTwMr2xSk.flv.info.json 
 "description": "Valse de Jo Privat Sa Pr\u00e9f\u00e9r\u00e9e. www.myspace.com/clementreboul"
$

Note "préférée" vs. "pr\u00e9f\u00e9r\u00e9e"

@phihag
Copy link
Contributor

@phihag phihag commented May 22, 2012

This is completely correct, see RFC 4627 2.5, second paragraph. To parse JSON, use a proper JSON parser. If you just want the description, use --write-description.

While we could encode non-ASCII characters as UTF-8 in our JSON output, I fear doing so would raise other issues.

@phihag phihag closed this May 22, 2012
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
2 participants
You can’t perform that action at this time.