Very weird problem...
-
While I was coding a fileparser I stubled upon something _very_ weird. My file started like this (in hex):
020102416E6369656E74277320506C6564676501536869656C64730152616C034F72740354616C012B353025
20456E68616E63656420446566656E736504436F6C6420526573697374202B34332504466972652052657369
7374202B343825044C696768746E696E6720526573697374202B34382504506F69736F6E2052657369737420
2B343825043130252044616D61676520476F657320546F204D616E6100426C61636B01436C7562730248616DTry pasting this into a new file using a hexeditor, save it, and then open it in Notepad. If you have chinese character-set installed it will for some reason show up in chinese. Why?! This is mostly plain english... I've tested this lots of times, and there seems to be no way around it, except uninstalling the chinese character set! Sprudling :omg: :eek: :-O PS! I'm using WindowsXP Pro
Check your Notepad default font settings Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
-
Check your Notepad default font settings Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
-
That was of course the first thing I checked and it's the WinXP default courier. It's only that file (and others starting with the same numbers in hex) that shows up in chinese. Have any of you even tested yet? Sprudling :omg:
What is the file extension you are using? The way I understand notepad is that if the extension is TXT it simply reads the file as ASCII and dumps it on the multi line edit control which is it's main control. Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
-
While I was coding a fileparser I stubled upon something _very_ weird. My file started like this (in hex):
020102416E6369656E74277320506C6564676501536869656C64730152616C034F72740354616C012B353025
20456E68616E63656420446566656E736504436F6C6420526573697374202B34332504466972652052657369
7374202B343825044C696768746E696E6720526573697374202B34382504506F69736F6E2052657369737420
2B343825043130252044616D61676520476F657320546F204D616E6100426C61636B01436C7562730248616DTry pasting this into a new file using a hexeditor, save it, and then open it in Notepad. If you have chinese character-set installed it will for some reason show up in chinese. Why?! This is mostly plain english... I've tested this lots of times, and there seems to be no way around it, except uninstalling the chinese character set! Sprudling :omg: :eek: :-O PS! I'm using WindowsXP Pro
Probably what is happening is that Notepad is using an auto-detect to see what encoding you are using. With those binary characters at the start, it is getting fooled into thinking it is something like UTF-16 (or whatever they call UNICODE). Tim Smith Descartes Systems Sciences, Inc.
-
Probably what is happening is that Notepad is using an auto-detect to see what encoding you are using. With those binary characters at the start, it is getting fooled into thinking it is something like UTF-16 (or whatever they call UNICODE). Tim Smith Descartes Systems Sciences, Inc.
I seriously doubt that Notepad does anything of that sort. It's only functionality is to open the file and read the contents into a multi line edit control. Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
-
I seriously doubt that Notepad does anything of that sort. It's only functionality is to open the file and read the contents into a multi line edit control. Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
BZZZZZ.... Wrong. Save something from Notepad. On the save dialog you get to select the encoding. Now, since there is no magical encoding flag in the file system, that information has to be stored in the file. When you open a file in notepad, it goes through some nasty work to try figure out the encoding. For example, UTF-16 can commonly be detected by looking for alternating 0 bytes. Tim Smith Descartes Systems Sciences, Inc.
-
BZZZZZ.... Wrong. Save something from Notepad. On the save dialog you get to select the encoding. Now, since there is no magical encoding flag in the file system, that information has to be stored in the file. When you open a file in notepad, it goes through some nasty work to try figure out the encoding. For example, UTF-16 can commonly be detected by looking for alternating 0 bytes. Tim Smith Descartes Systems Sciences, Inc.
Oh Boy!!! Thanks Tim S. Thanks for the info. But this is bad. This means notepad is not a pure text editor anymore. Now what do we do? Windows comes with not a single pure text editor. Do we all have to go back to the COPY CON days??? Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
-
Oh Boy!!! Thanks Tim S. Thanks for the info. But this is bad. This means notepad is not a pure text editor anymore. Now what do we do? Windows comes with not a single pure text editor. Do we all have to go back to the COPY CON days??? Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
-
What is the file extension you are using? The way I understand notepad is that if the extension is TXT it simply reads the file as ASCII and dumps it on the multi line edit control which is it's main control. Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
The extension doesn't matter. I can rename the file to whatever I want, and it shows the same chinese signs. Anyway, I think I've figured out why this happens how. Then the WinXP parses a file it tries to find out if it's ASCII or Unicode. An experiment: - Create a new .txt file in Notepad, enter "Sprudling", and save it as usual. - Open the file in an hexeditor and insert 2 bytes in front og "Sprudling". - Set the 2 bytes to FFFE, and save the file again. - Now open it again in Notepad. It's now shown in unicode as "灓畲汤湩", which is 4 chinese letters for those who actually have installed those letters. I guess Notepad is more than you thought... :] Sprudling :)
-
heh... COPY CON Been there, done that. GOD I AM GETTING OLD!!! Tim Smith Descartes Systems Sciences, Inc.
Tim Smith wrote: GOD I AM GETTING OLD!!! Yes, I agree ;P Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
-
The extension doesn't matter. I can rename the file to whatever I want, and it shows the same chinese signs. Anyway, I think I've figured out why this happens how. Then the WinXP parses a file it tries to find out if it's ASCII or Unicode. An experiment: - Create a new .txt file in Notepad, enter "Sprudling", and save it as usual. - Open the file in an hexeditor and insert 2 bytes in front og "Sprudling". - Set the 2 bytes to FFFE, and save the file again. - Now open it again in Notepad. It's now shown in unicode as "灓畲汤湩", which is 4 chinese letters for those who actually have installed those letters. I guess Notepad is more than you thought... :] Sprudling :)
Yeah. Tim Smith cleared that up for me :-) But he says he's getting old :-) Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
-
Oh Boy!!! Thanks Tim S. Thanks for the info. But this is bad. This means notepad is not a pure text editor anymore. Now what do we do? Windows comes with not a single pure text editor. Do we all have to go back to the COPY CON days??? Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
-
edit.com was introduced with DOS 5.0 [it was part of the qbasic set] later it became stand-alone Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut