Last modified: 2013-10-21 15:00:25 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T56726, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 54726 - Support for unicode text input in cmd on windows
Support for unicode text input in cmd on windows
Status: RESOLVED FIXED
Product: Pywikibot
Classification: Unclassified
General (Other open bugs)
core-(2.0)
PC All
: Normal normal
: ---
Assigned To: Merlijn van Deen (test)
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-27 23:01 UTC by Siddhartha Ghai
Modified: 2013-10-21 15:00 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Siddhartha Ghai 2013-09-27 23:01:53 UTC
System Environment:
Windows 7 X64 SP1
CLI: cmd.exe

As of now, the Core branch of the framework doesn't seem to support direct unicode input in the CLI.

The command:

python pwb.py C:/Users/username/core/scripts/add_text.py -page:%E0%A4%B8%E0%A4%A6%E0%A4%B8%E0%A5%8D%E0%A4%AF:Siddhartha_Ghai/sandbox17 -text:"जाँच" -summary:"जाँच"

gave this diff:
https://hi.wikipedia.org/w/index.php?title=%E0%A4%B8%E0%A4%A6%E0%A4%B8%E0%A5%8D%E0%A4%AF%3ASiddhartha_Ghai%2Fsandbox17&diff=2214593&oldid=2214592

The devanagari input text and the editsummary both are lost as question marks.
Comment 1 Siddhartha Ghai 2013-09-27 23:03:05 UTC
Note: The add_text.py file used was downloaded from https://git.wikimedia.org/raw/pywikibot%2Fcompat.git/929557870a21e945ef7e8f8690960361e5fb62a1/add_text.py and then the import statements were modified.
Comment 2 Merlijn van Deen (test) 2013-09-27 23:06:00 UTC
Note to myself: support is there, but it's not implemented into handleArgs (and pwb.py might also need some adaptation)

null.py is an empty file...

...n\pwb>python -i pwb.py null.py  के अवतरणों में अंतर
>>> import pywikibot
>>> pywikibot.handleArgs()
[u'null.py', u'??', u'???????', u'???', u'????']
>>> from pywikibot.userinterfaces.win32_unicode import argv
>>> argv
['pwb.py', 'null.py', '\xe0\xa4\x95\xe0\xa5\x87', '\xe0\xa4\x85\xe0\xa4\xb5\xe0\xa4\xa4\xe0\xa4\xb0\xe0\xa4\xa3\xe0\xa5\x8b\xe0\xa4\x82', '\xe0\xa4\xae\xe0\xa5\x87\xe0\xa4\x82', '\xe0\xa4\x85\xe0\xa4\x82\xe0\xa4\xa4\xe0\xa4\xb0']
>>> [x.decode('utf-8') for x in argv]
[u'pwb.py', u'null.py', u'\u0915\u0947', u'\u0905\u0935\u0924\u0930\u0923\u094b\u0902', u'\u092e\u0947\u0902', u'\u0905\u0902\u0924\u0930']
>>> pywikibot.output(u' '.join(x.decode('utf-8') for x in argv))
pwb.py null.py के अवतरणों में अंतर
Comment 3 Gerrit Notification Bot 2013-09-28 17:54:17 UTC
Change 86386 had a related patch set uploaded by Merlijn van Deen:
Bug 54726 - Add Windows unicode cmd argument support

https://gerrit.wikimedia.org/r/86386
Comment 4 Merlijn van Deen (test) 2013-10-19 18:22:52 UTC
Siddhartha, if you feel comfortable enough with git, please fetch the last patchset of https://gerrit.wikimedia.org/r/#/c/86386/ and test if it works for you.

using command-line git, this is the command:

git fetch https://gerrit.wikimedia.org/r/pywikibot/core refs/changes/86/86386/5 && git checkout FETCH_HEAD
Comment 5 Gerrit Notification Bot 2013-10-21 14:55:05 UTC
Change 86386 merged by jenkins-bot:
Bug 54726 - Add Windows unicode cmd argument support

https://gerrit.wikimedia.org/r/86386

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links