I have a python script (based on pywikibot) which works fine when called from bash terminal. The call include parameters that contain Unicode strings, and the output also contains Unicode strings and will result in editing a page whose title contains Unicode characters as well. I put the call in a bash script and ran it from terminal and that also worked fine.
Then I called the bash script using jsub -once. The result was that the bot edited the page [[w:fa:ÙÛÚ©ÛâپدÛا:گزارش دÛتابÛس/Ù ÙاÙÙâÙØ§Û Ú©ØªØ§Ø¨]] instead of the expected [[w:fa:ویکیپدیا:گزارش دیتابیس/مقالههای کتاب]].
Somehow, running the script through jsub will result in encoding issues. The python script can be found here, and the bash script is attached.