From: SourceForge.net <no...@so...> - 2007-01-26 21:00:16
|
Bugs item #1203699, was opened at 2005-05-17 08:46 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=373085&aid=1203699&group_id=22049 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: User-Interface Group: 2.0 Series Status: Closed Resolution: Wont Fix Priority: 5 Private: No Submitted By: Jasper Taylor (jaspert) Assigned to: Amir Szekely (kichik) Summary: Non-ASCII characters in directory path replaced by ????????? Initial Comment: When I run an installation created with NSIS, if I choose to place the installation in a directory whose path includes non-ASCII characters (for example, Шеварднадзе or 新聞局中文全球資訊網) these characters are replaced by queries in the subsequent dialogues, and removed altogether from the path in which the actual installation is placed. The installation fails if the result is not a legal directory path. I'm using NSIS 2.06, both building and installing on a Windows XP machine with the extra character sets installed. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2007-01-26 13:00 Message: Logged In: NO I have noticed this problem as well and just thought I should post the method I use to get the error. In my installer the user has a choice to use an auto-detected path or to choose one themselves. The auto-detected path finds a root directory, searches from their for a certain file and then returns the path to that file. In the manual selection the user is asked to choose where that file is on their computer. This path is then used to install the files in a subdirectory. i.e. if the file is in c:\root\fileDir then the program will install too c:\root\fileDir\InstDir If fileDir is a series of UNICODE, the path field on the directory page will display all the offending characters as ? and it will drop the offending directory without a warning and install to c:\root\InstDir The computer this is being tested on has the proper language packs installed and will display the correct characters in explorer. The default language is English (US). ---------------------------------------------------------------------- Comment By: Amir Szekely (kichik) Date: 2005-06-19 11:32 Message: Logged In: YES user_id=584402 Dialogs in different languages than the default language for non-Unicode applications will indeed not show up right. Coping with Unicode strings in the directory would mean using Unicode API which is only available on the Windows NT family. It is possible support both NT and 9x by dynamically loading the Unicode API, but that's a lot of work. I am pretty sure there is already a feature request about it. If not, it's a pretty obvious feature anyway, so there's no need to worry about it being considered/remembered. It's not possible to use quoting to get ANSI API to deal with Unicode. ANSI API only handles the code page of the language for non-Unicode applications. Thanks for your report. ---------------------------------------------------------------------- Comment By: Jasper Taylor (jaspert) Date: 2005-06-19 09:51 Message: Logged In: YES user_id=456242 What happened was, after I chose the directory the pathname was displayed as M:\Documents and settings\??????????\Findable When saving the file the ? marks were removed from the path, and the installation appeared in M:\Documents and settings\Findable. But by mixing ascii and Unicode characters it was possible to get it to try to save in a nonexistent directory, which caused installation to abort. I take it that lack of Unicode support means that installation dialogues in different languages will only appear correctly if the appropriate language has been selected for non-Unicode programs. Is there no way it could cope with a Unicode string in a directory path? I've no idea how the Windows API manages these things, but I'm guessing the program could merely quote the directory name back to the API as part of the chosen path even if it could not display it correctly. Thanks for your effort looking at this... ---------------------------------------------------------------------- Comment By: Amir Szekely (kichik) Date: 2005-06-19 09:34 Message: Logged In: YES user_id=584402 When you said "replaced by queries in the subsequent dialogues", did you mean they are replaced by question marks or that they are replaced with strings from other dialogs? ---------------------------------------------------------------------- Comment By: Amir Szekely (kichik) Date: 2005-06-19 09:25 Message: Logged In: YES user_id=584402 That's not good. NSIS doesn't support Unicode and you therefore can't use directories which are not in your language for non-Unicode programs. However, it shouldn't result in insertion of other variables into the string. It should ignore the selected directory somehow... I know how to install support for Asian languages, that's what I've been trying to avoid (lack of HD space). But that's no longer needed, I now know what the problem is - the language for non-Unicode programs. ---------------------------------------------------------------------- Comment By: Jasper Taylor (jaspert) Date: 2005-06-19 09:18 Message: Logged In: YES user_id=456242 My language for non-Unicode programs is English (United States). I think that what you need to do to create Chinese directory names is go to the 'Languages' tab under Regional and Language Options, and select the 'Install files for East Asian languages' option under Supplemental Language Support. Trying to save the directory name from Notepad gives me a warning: 'This file contains characters in Unicode format which will be lost if you save this file as an ANSI encoded text file...' ---------------------------------------------------------------------- Comment By: Amir Szekely (kichik) Date: 2005-06-19 08:30 Message: Logged In: YES user_id=584402 Open the file with Notepad and in the save dialog, choose ANSI in the Encoding combobox (it's on the bottom). Changing a name of directory locally won't work for me, because my language for non-Unicode applications is Hebrew and not Chinese. And since it's already come up, what's yours? Go to Control Panel->Regional and Language Options->Advanced to check it out. ---------------------------------------------------------------------- Comment By: Jasper Taylor (jaspert) Date: 2005-06-19 08:25 Message: Logged In: YES user_id=456242 I'm sorry I don't know how to do that -- emacs allows me to save these in many different encodings, but I don't know what you are after. What I suggest you do is go to a website with Chinese characters, such as www.bbc.co.uk/chinese, copy a line of characters and paste it into a directory name in Windows. That's more or less what I did, and I tried a few different Chinese and Cyrillic (Russian) strings with the same results I described when choosing these as installation directories for NSIS packages. ---------------------------------------------------------------------- Comment By: Amir Szekely (kichik) Date: 2005-06-19 02:33 Message: Logged In: YES user_id=584402 Can you attach a file with those characters saved in ASCII mode and not UTF-8? I want to see if there is anything in common between them. I'll probably create some debug version and upload it here soon, to find out what's going on. ---------------------------------------------------------------------- Comment By: Jasper Taylor (jaspert) Date: 2005-06-13 02:16 Message: Logged In: YES user_id=456242 Like I said, I already had a directory on my machine with these characters in its name. When running my installer script I got to the installation directory dialogue, then browsed to this directory and tried to install to another directory inside it. ---------------------------------------------------------------------- Comment By: Amir Szekely (kichik) Date: 2005-06-13 02:08 Message: Logged In: YES user_id=584402 If you didn't enter those characters into the directory dialog, where do they come into play? Did you use them in InstallDir? Did you read it from the registry and used that as $INSTDIR? Can you attach a piece of code explaining exactly where those characters are introduced into the script? ---------------------------------------------------------------------- Comment By: Jasper Taylor (jaspert) Date: 2005-06-12 14:30 Message: Logged In: YES user_id=456242 OK, sorry...looks like the Unicode characters I was using don't enter into this entry widget very nicely, here's the first lot again just in case -- 新聞局中文全球資訊網 -- and I also attach a file containing them. These are UTF8-encoded Unicode characters from some oriental alphabet. The 2nd example was Eduard Shavadnadze's name in Cyrillic. Note none of these are 8-bit Ascii characters, and you will need to have the appropriate language extensions installed on your Windows machine to display them at all. Also the problem was not in entering these characters into the NSIS directory name dialogue. I actually didn't try that. I just tried to install my package into a subdirectory of an already existing directory containing these characters. --Jasper ---------------------------------------------------------------------- Comment By: Amir Szekely (kichik) Date: 2005-06-10 08:17 Message: Logged In: YES user_id=584402 I am not able to reproduce this. I've tried using characters with high ASCII values up to 255 and nothing like that happened. If you're not a developer, please attach a file with those characters written into it, saved in ASCII mode. If you are a developer, would you mind taking a look at validate_filename in Source\exehead\util.c? That should be the only function called on the input from the directory page. It is MBCS aware, so this shouldn't happen. But there might be some bug in it... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=373085&aid=1203699&group_id=22049 |