Old 16th October 2003, 15:10   #1
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
UTF-8 scripts

i figured that utf-8 scripts (like scripts containing Chinese, Japanese, Korean) don't compile, since one has to remove the "" at the very beginning of the document. maybe nsis should ignore that, so one does not have to edit the script each time it's been saved.
Yathosho is offline   Reply With Quote
Old 16th October 2003, 15:12   #2
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
NSIS does not use Unicode, because it is not supported by Win9x.
Joost Verburg is offline   Reply With Quote
Old 18th October 2003, 15:27   #3
DrO
 
Join Date: Sep 2003
Posts: 27,873
you could just have a small program that processes the file beforehand to convert the file into ansi so nsis can cope with it.

you could use a richedit v2 control to load the file and then save it out as a normal text file. not the best of ideas since some of the extra characters (especially for languages that need it) would be lost but it would give you a useable file

-daz
DrO is offline   Reply With Quote
Old 25th October 2003, 15:38   #4
DrO
 
Join Date: Sep 2003
Posts: 27,873
had a few minutes to kill and knocked up this.

the program will convert a unicode file to ansi (not exactly sure how things will be mapped with files that fully use extended characters) and it requires riched20.dll (richedit v2+ basically on most machines now - checks for this on init).

usage: create a shortcut to the test program (for the moment) and add the file to convert onto the end of the target string.

at the moment it will output to 'convert.nsi' but will increase the features for tomorrow (only spent 30 minutes on it )

-daz
Attached Files
File Type: zip nsis_utf8_conv.zip (3.6 KB, 538 views)
DrO is offline   Reply With Quote
Old 25th October 2003, 15:57   #5
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Why would you use richedit to do this conversion? It isn't really something you should use for conversion.

You can convert text to ANSI using any text editor like Notepad.
Joost Verburg is offline   Reply With Quote
Old 25th October 2003, 17:03   #6
DrO
 
Join Date: Sep 2003
Posts: 27,873
i know it's not the best method to use for conversion but it's just doing the same as a text editor would do (though notepad on my win98 system can't do that conversion).

thought it would be useful to have a simple conversion from a unicode file to ansi which is automatically done, nevermind

-daz
DrO is offline   Reply With Quote
Old 25th October 2003, 17:08   #7
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Why not use WideCharToMultiByte?

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 25th October 2003, 17:17   #8
DrO
 
Join Date: Sep 2003
Posts: 27,873
hadn't considered that until Joost posted. thought the richedit idea was a simple way to do it since from what i understand it will convert things using WideCharToMultiByte internally (so it will cope with displaying in the ansi version of the richedit control).

-daz
DrO is offline   Reply With Quote
Old 25th October 2003, 17:25   #9
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
All NT versions of Notepad support this convertion. Because Win9x doesn't support Unicode, it's unlikely that anyone using Win9x would product Unicode files.

If you want to convert a file, you'd better use standard Windows API than a RichEdit control (which is designed to display data).
Joost Verburg is offline   Reply With Quote
Old 25th October 2003, 17:35   #10
DrO
 
Join Date: Sep 2003
Posts: 27,873
oops, should have realised that. using the api's does make more sense now i've had it pointed out, just not sure why i didn't think about it earlier. (feel very stupid now but thank you for pointing things out)

-daz
DrO is offline   Reply With Quote
Old 27th October 2003, 15:57   #11
DrO
 
Join Date: Sep 2003
Posts: 27,873
taking comments made earlier i had a go at using the WideCharToMultiByte and this is what i've done.

When calling it just pass the filename to read and the file to save to and if all is fine it will generate a ansi version of the file (will indicate errors via messageboxes at the moment).

The file paths need to be full paths and if they are long names then it is advisable to put quotes around the path ("c:\blah blah.log").

It will also check before conversion to see if the file is unicode or not (which is sensible).
It currently won't strip out the unicode file indicator from the start if there is one (hence the wierd character at the start of converted files)

Slightly off topic, it could be useful for makensisw to have the ability to run a preprocessing script/program (like vc++, etc can do). Just a thought

-daz
Attached Files
File Type: zip v2.zip (9.4 KB, 468 views)
DrO is offline   Reply With Quote
Old 4th January 2004, 11:08   #12
OCedHrt
Junior Member
 
Join Date: May 2002
Posts: 39
Win9x doesn't need to support unicode because of MSFT's Unicode Layer. I have asked several developers who are familiar with coding w/ unicode and they all say that it is no where near as difficult and daunting a task as most developers think it is.

-wow..I can't type

Last edited by OCedHrt; 4th January 2004 at 11:24.
OCedHrt is offline   Reply With Quote
Old 4th January 2004, 11:19   #13
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Then NSIS would have to include huge and buggy Win9x Unicode libraries, which will make your installer more than 10 times larger.
Joost Verburg is offline   Reply With Quote
Old 4th January 2004, 11:23   #14
OCedHrt
Junior Member
 
Join Date: May 2002
Posts: 39
Dunno, maybe. But the dll itself is < 245k. Maybe that is 10 times larger..hm. dunno how big NSIS is but still..
OCedHrt is offline   Reply With Quote
Old 4th January 2004, 11:31   #15
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
The NSIS exehead is only 34 KB large. Supporting this buggy library would require lots of work, we would have to create sepeate Win9x/NT code and include the library which is almost 10 times larger than the installer itself.

So it is not possible to support it. However, NSIS does support MBCS so you can still use all languages.
Joost Verburg is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump