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

Cannot create post with latin characters in title #4714

Closed
diegomagikal opened this Issue Feb 28, 2018 · 2 comments

Comments

3 participants
@diegomagikal

diegomagikal commented Feb 28, 2018

Environment:
Windows7, Wamp, WP-CLI, 1.5

Summary:
Cannot create post with latin characters in post title

Command to reproduce the bug:
wp post create --post_type=page --post_status=publish --post_title="Perícias Contábeis"
or
wp post create --post_type=page --post_status=publish --post_title="Atuação"

Actual Results:
Error: Não foi possível inserir o post no banco de dados

If I remove the characters "í", "á", "ç" and "ã" (Portuguese), the post is saved.
wp post create --post_type=page --post_status=publish --post_title="Pericias Contabeis"
Result:
Success: Created post 56

@gitlost

This comment has been minimized.

Contributor

gitlost commented Mar 4, 2018

Thanks for the report @diegomagikal . Using UTF-8 in PHP arguments doesn't work on Windows for PHP <= 7.0, however it will work for PHP >= 7.1, as it was fixed as part of Support for long and UTF-8 path. A workaround for PHP <= 7.0 is to use the --prompt option:

echo "Perícias Contábeis" | wp post create --post_type=page --post_status=publish --prompt=post_title

This issue should probably be added to https://make.wordpress.org/cli/handbook/common-issues/

@diegomagikal

This comment has been minimized.

diegomagikal commented Mar 8, 2018

Thanks, I updated my environment to php 7.2.30 and it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment