Jump to content

No Unicode / System Locale Dependency for Web API SubPath


Recommended Posts

uTorrent Version: (also with older versions)

OS: Windows 7 x64 Ultimate (also tested with Windows 7 x86 Enterprise)

Although the uTorrent Windows UI (Add Torrent (choose save dir)...) works flawlessly with non ASCII/Unicode characters in the folder path, the Web API still dependent on the currently configured system locale of the Windows (for non-unicode applications) therefore it's not possible to use any subpath which can't be translated to the current locale.


1. Windows is configured to use Japanese for non-Unicode applications (eg. code page will be shift-jis).

2. The following request sent to uTorrent: http://localhost:7777/gui/?path=Temp%5cテスト&token=vhez0VXg3Xqx3TM9eZqEoB1UaJiNfOo0WW6B_bkNW4MIkqIE4PH1Z-VL2lEAAAAA&act


Response: {"build":29806}

Result: Torrent added to the queue but instead of the expected path ("Temp\テスト") it's a garbled path due to the utf-8/unicode encoding misinterpretation.

If I send a request with the path urlencoded as a shift-jis text: http://localhost:7777/gui/?path=Temp%5c%83e%83X%83g&token=3pdwMCDQjk3rP-HGeg3OBpXozSjUR476ypj5vzOHQPVL_afH6TeAm9ZK2lEAAAAA&


The path will be correctly created with the Japanese characters.

Unfortunately with this problem it's not possible to use any characters in the path which is not in the current locale (for example use Korean folder name on a Windows with Japanese system locale).

A possible workaround would be to add every single folder as a predefined download directory, but unfortunately I would like to use the Web API capabilities in a multilingual scripting scenario where I can't define every possible paths preliminary and can't limit the usage for one language.

Thank you

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...