Closed (fixed)
Project:
Drush
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 May 2010 at 08:34 UTC
Updated:
19 Jun 2010 at 15:20 UTC
Jump to comment: Most recent file
Drupal's data is always in UTF-8 but console is not. It makes trouble to use drush with sites where default language is not english.
In my case shell code page is KOI8-R and site default language is russian. In order to get right output I pipe drush with command 'iconv -f UTF-8 -t KOI8-R' to convert characters from UTF-8 to KOI8-R. It works until drush wait input from user (like y/n question). In the last case drush hungs.
Drush have to determine console code page automatically and make such conversion by oneself. Or drush have to have option (cmdline and drushrc) to convert output to the specified encoding.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | output_charset.patch | 1.3 KB | v.sidorov |
Comments
Comment #1
greg.1.anderson commentedIt would be pretty easy to wrap output with php iconv in
drush_print()et. al. if an appropriate option is set in drushrc.php. It also seems that UTF-8 should work just fine with the right system configuration and terminal, but I see no reason why drush couldn't also support older encodings.Patches welcome.
Comment #2
v.sidorov commentedAdded option output_charset to translate output from UTF-8. Option can be specified in command line as
or in drushrc.php as
Patch here.
includes/drush.inc:
examples/example.drushrc.php:
Comment #3
v.sidorov commentedDo you accept this patch?
Comment #4
greg.1.anderson commentedThe code looks good, but I'm travelling on business this week and last week, and won't have a chance to look at it until next week. You could increase your odds that some other maintainer might take a look if you rolled a .patch file and set the status of the issue to "needs review". (Heck, I might forget to come back to this issue if you don't do that...)
Comment #5
moshe weitzman commentedcode looks good from my perspective as well. In addition to a real patch file, I'd love some instructions on how to test this using OSX.
Comment #6
v.sidorov commentedPatch file attached. Status changed.
To test this... It is really not easy. Lets try this scenario.
Comment #7
moshe weitzman commentedThe patch wouldn't apply for me (See diff and patch page for help). But I copied the changes and your test steps worked out perfectly so I committed this.
Comment #8
v.sidorov commentedPlease commit the following code to examples/example.drushrc.php file as a bit of documentation. Otherwise there is no info about output_charset option. Thank you.
Comment #9
moshe weitzman commented#797700 by v.sidorov | greg.1.anderson: Added Convert drush output to terminal console code page.