i do some translation work, and when i download the file - and do not change anything, it saves normally, formatted and all.
But when i translate some strings, all formatting get's lost when i save the file.
I have been forced to use another program -instead of the normal Windows notepad - to have a workaround - but right now, i'd like to know WHY it happens, and if there is a cure, since it keeps coming back (i believe i even had the problem on my 32- bit OS)
i noticed that only on the file for that program - others do NOT have the problem
the file is in UTF-8 format
SoftwareWindows 7Microsoft Legacy OSWindows OS
Last Comment
nobus
8/22/2022 - Mon
David Johnson, CD
the file is in UTF-8 format
nobus
ASKER
what do you mean? it is in UTF-8 and i did not change anything
what am i supposed to change ?
options are unicode - unicode big endian - ANSI
Wiesje
What ve3ofa means is that when you save the notepad file, check that you select UTF-8 in de dropdown box when using Save As.
The options I get in my notepad Save As are:
ANSI, unicode, unicdoe big endian and UTF-8.
If UTF-8 is missing from the notepad save as option list, please let us know. Perhaps it is due to the version of Windows you have.
Another very good notepad application which can do the same is Notepad++.
if you care to read, i posted : it is in UTF-8 and i did not change anything - meaning it is save d as UTF-8
and i know nNotepad++, it's the one i used before -as said, i want to look WHY it happensonly on this file
Wiesje
I understand that. The question I asked was: What version of Windows are you using?
And do you get the option to save as UTF-8 in your notepad version?
I do understand that the file was previously UTF-8 and that it should still be in UT-8. Why it loses it's formatting usually only occurs when it changes from type. That is why we need to know if your notepad still saves as UTF-8.
nobus
ASKER
i said i did not change it, SO IT WAS SAVED AS UTF-8
yes the option is there - i meant OTHER options were the 3 i posted
the windows i use is posted in my Question
Well, that's not really what I asked.
e.g. here's what a procedure to make a bootable USB for Dell XP-SP3 OEM looks like in Notepad after saving it, but below that is the same procedure, simply copied and pasted from Notepad to this comment box. Notice how the formatting that 'seems' missing in Notepad has magically reappeared.
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-124, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-124, default 124):
Using default value 124
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 6
Changed system type of partition 1 to 6 (FAT16)
Command (m for help): a
Partition number (1-4): 1
Command (m for help): w
The partition table has been altered!
Hmmm... I'm thinking that sample NFS /etc/fstab 'mount' command doesn't actually belong to that bootable USB procedure... it just got mixed in because the formatting appears to be missing in Notepad.
nobus
ASKER
Darr247 i think your idea is good, - when i copy the (let's call it scrambled) scrambled txt to the comment box, the formatting reappears.
So good thing is - it's still there
Only point left : how to get it back in Notepad
Weirdly, if I paste it into Wordpad, the formatting is there.
Then, in Wordpad, if I use Save as on the file menu 'tab', and choose 'Other formats' then in Save as type select Unicode Text Document (with .txt extension), I get a warning that it's going to lose all formatting, which I OK through, then finish the Save... when I double-click it, it still opens in Notepad (because of the .txt association), but now the formatting is visible again.
There is no UTF-8 option in Wordpad... but I *think* UTF-8 is a subset of Unicode, isn't it?
nobus
ASKER
where is wordpad? i have Office 2010
Darr247
Orb/Start -> All Programs -> Accessories
The path to it in my win7 x64 is "%ProgramFiles%\Windows NT\Accessories\wordpad.exe"
and what is a solution then ve3ofa ? (where did you find that nickname?)
nobus
ASKER
i want to say -if i do not change anything to the file, i can save it without havving the problem; only when i replace the string after the = sign and save it - formatting gets lost
David Johnson, CD
well for this application I'd use notepad++ and not wordpad/notepad or even word.. what was really surprising was the 2 x cr and then the lf in the original file. as for the handle it is/was my amateur radio callsign. I'm an advanced amateur without a radio.
Ok guys, this looks like it's going in the right direction.
to summarise, i have 2 solutions : use notepad ++, or use notepad with word wrap off, right?
last questions : do you see any way to get the "scrambled" file to dispaly properly again?
and if i want to change the notepad exe, which Hex editor do you recommend for that?
Darr247
Wow@ the notepad bug. And it's not just in XP... I'm running Win7. I saw it happening and didn't even realize Notepad was doing it. The Notepad (v6.1.7600.16385, 192,536 bytes) in my Win7 x64 ( I don't know how to tell if it's actually a 64-bit application) does not have the string that blog article cites, so it apparently can't be fixed.
The method I described earlier -- paste into Wordpad, Save As... 'Other' ->Unicode, then open in Notepad (with Word Wrap turned off, ALWAYS from now on, I guess) and then back in Notepad using File->Save As... 'UTF-8' seems like it should convert them back, but I don't have any files to test it on that were UTF-8 to begin with (I've always just used Unicode, not UTF-8).
qz8dsw
last questions : do you see any way to get the "scrambled" file to display properly again?
No. once the <CR><CR><LF> are gone there is no way to put them back other than manually going through the file and hitting enter where it's needed.(And that will put in the standard <CR><LF>)
And you have a 3rd option, use a hex or advanced text editor to replace all occurences of <CR><CR> with <CR>
That would bring the file back in line with standard text and then notepad with word wrap turned on will be fine, but your other 2 options are correct. Notepad with word wrap turned off, or another editor like notepad++.
@Darr247
And you are correct, my Win7 64 bit notepad does not have the hex string either, but that is not surprising as they would not just be re-compiling it for all these years.
It can be fixed, just a different hex string so notepad would need to be debugged again to find the correct point to make the change. I'd not really call it a bug, just the method Microsoft has chosen to do word wrap so it is easily removable when saving. Unfortunately the file is using <CR><CR><LF> for end of line.
i was VERY pleased with the ideas and solutions, and help offered
i sure would like to hand out more points - since you helped me understand an OLD problem, that kept reappearing