mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2009
Posts: 295
P
pball Offline OP
Fjord artisan
OP Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
//write test.txt $chr(167) $+ hey $chr(171) $+ you $+ $chr(172)

in mirc 7.14 writes
§hey «you¬

in mirc 6.35
§hey «you¬


http://scripting.pball.win
My personal site with some scripts I've released.
Joined: Dec 2002
Posts: 344
D
Pan-dimensional mouse
Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
It works fine for me. What version of Windows are you using, and what text editor are you using to view the contents of test.txt?

What do you get if you do $read(test.txt,1) ?

Joined: Nov 2009
Posts: 295
P
pball Offline OP
Fjord artisan
OP Offline
Fjord artisan
P
Joined: Nov 2009
Posts: 295
Windows 7

reading the file from mirc doesn't show the accented A
viewing in notepad doesn't show it

viewing in wordpad, firefox shows the accented A

I noticed the problem because I'm writing an html file and it appears when that page is viewed


http://scripting.pball.win
My personal site with some scripts I've released.
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You may not have your encoding set to Unicode in Firefox and Wordpad may also have some kind of similar setting. I don't use Wordpad, so I don't know for sure on that one.


Invision Support
#Invision on irc.irchighway.net
Joined: Dec 2002
Posts: 344
D
Pan-dimensional mouse
Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
OK, I see what's going on. Note that mIRC is writing to the file correctly, but mIRC does not add a byte order mark (BOM) to the beginning of the file. If no BOM is present, a text editor has to guess whether or not the file is Unicode or plain ASCII. In this case, Wordpad appears to be assuming that all text is plain ASCII unless it sees a BOM, while Notepad will use intelligent "guessing" if no BOM is present.

Depending on your application, you may or may not want a BOM in the file so I don't think it is a good idea for /write to automatically add it. If this is only a one-time issue where you need to add a BOM to the file, an easy way to do it is to just open the file in Notepad then save it, as Notepad will automatically add the BOM if it's not already present.


Link Copied to Clipboard