Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

Q and A Windows Notepad, Change Default "Save As" -> "Unicode"

views
     
TSsheeeng
post Sep 21 2006, 09:47 PM, updated 20y ago

ソフト エンジニア
****
Senior Member
688 posts

Joined: Feb 2005
From: クアラルンプール
Hi all, smile.gif

How can I change the Windows Notepad default saving encoding from ANSI to Unicode? icon_question.gif

I manage many Unicode-based text.

Is there a workaround so that I do not need to set saving encoding everytime I open and save a new notepad?

Thanks in advance.
Sky.Live
post Sep 21 2006, 10:05 PM

Proctected Species
*******
Senior Member
4,390 posts

Joined: Oct 2004
From: Cheras, Malaysia



wa.. tht's interesting too.. i wanted to know too
samurai1337
post Sep 22 2006, 08:05 PM

@_@
Group Icon
VIP
11,594 posts

Joined: Jan 2003
From: Area 51

Don't think you can, checked HKEY_CURRENT_USER\Software\Microsoft\Notepad but can't see any related settings you can tweak around there (not sure if IfCharSet does you the job)

Maybe you can try more advanced text editor like UltraEdit

This post has been edited by samurai1337: Sep 22 2006, 08:19 PM
AsenDURE
post Sep 25 2006, 10:37 PM

je suis desole. je n'y crois pas a ces conneries!!
Group Icon
VIP
2,496 posts

Joined: Jan 2003
From: LowYatDotNet Status:Agast
if you're using it on the web then i suggest you take samurai1337's advice. give up notepad. when saving as unicode (UTF-8), notepad adds a signature/ byte-order mark, that is not required in UTF-8. it will break your unicode UTF-8 pages (sometimes) to the extent that you will need a hex editor to fix them.

TSsheeeng
post Nov 6 2006, 07:46 AM

ソフト エンジニア
****
Senior Member
688 posts

Joined: Feb 2005
From: クアラルンプール
Thanks for all your advice.

So, using 3rd party apps will be better, rite? e.g. UltraEdit? Notepad++?
samurai1337
post Nov 6 2006, 07:53 AM

@_@
Group Icon
VIP
11,594 posts

Joined: Jan 2003
From: Area 51

Yes, if you're going for freeware, I'd suggest Notepad++ or PSPad
porkchop
post Nov 6 2006, 12:02 PM

Lalala Life's Sweet
*******
Senior Member
6,633 posts

Joined: Jan 2003
From: www.kelvinchiew.com


pspad is recommended , using it now
eek-1
post Nov 6 2006, 12:16 PM

Custom member title
*****
Senior Member
778 posts

Joined: Jan 2003
From: Polysiloxanes Boulevard



Notepad2 looks mostly like notepad original, included UTF-8 support of course.

This post has been edited by eek-1: Nov 6 2006, 12:17 PM
natakaasd
post Nov 7 2006, 10:45 AM

Look at all my stars!!
*******
Senior Member
2,188 posts

Joined: Nov 2005


UltraEdit is quite a better shot. With it, you can even program in other programming languages with the syntax codes highlighted, not to mention the flexible hex editor in it.
sleepsleep
post Nov 9 2006, 12:46 AM

Casual
***
Junior Member
311 posts

Joined: Sep 2006


after tracing it for a little while with ollydebugger, well, got a solution wink.gif

the idea is like below.
if the document haven't been saved before (new), and when you click save as or save, only 3 types works, {unicode, unicode big endian and utf8 = default to utf8 (although it shows ansi in the encode combobox)}

if you open a saved .txt (ansi, uni, unibig or utf8), it would save to its opened format.

the save default to UTF8 only works on new document you created.

copy the modified one into c:\windows and c:\windows\system32
and backup the old one.

to save a new document into ansi, what you could do is, right click and choose new => text document (on desktop or any folder) and save it, then u can use this mod notepad to open or save it ~ would save into ansi format.

a little bit about what code i inject

CODE

; i added the below into notepad
01007D77   > 50             PUSH EAX                                ; |
01007D78     A1 28950001    MOV EAX,DWORD PTR DS:[1009528]
01007D7D     83F8 01        CMP EAX,1
01007D80     74 0F          JE SHORT UTFNOTEP.01007D91
01007D82     83F8 02        CMP EAX,2
01007D85     74 0A          JE SHORT UTFNOTEP.01007D91
01007D87     B8 03000000    MOV EAX,3
01007D8C     A3 28950001    MOV DWORD PTR DS:[1009528],EAX
01007D91     58             POP EAX
01007D92     6A 04          PUSH 4
01007D94     56             PUSH ESI
01007D95     6A 03          PUSH 3
01007D97     68 000000C0    PUSH C0000000
01007D9C     50             PUSH EAX
01007D9D     FF15 18110001  CALL DWORD PTR DS:[<&KERNEL32.CreateFile>;  kernel32.CreateFileW
01007DA3    ^E9 37CDFFFF    JMP UTFNOTEP.01004ADF


i modify the following
CODE

01004ACC  |> 6A 04          PUSH 4                                  ; |Mode = OPEN_ALWAYS
01004ACE  |. 56             PUSH ESI                                ; |pSecurity
01004ACF  |. 6A 03          PUSH 3                                  ; |ShareMode = FILE_SHARE_READ|FILE_SHARE_WRITE
01004AD1  |. 68 000000C0    PUSH C0000000                          ; |Access = GENERIC_READ|GENERIC_WRITE
01004AD6  |. FF75 0C        PUSH DWORD PTR SS:[EBP+C]              ; |FileName
01004AD9  |. FF15 18110001  CALL DWORD PTR DS:[<&KERNEL32.CreateFile>; \CreateFileW


to

CODE

01004ACC     90                        NOP                                            ; |Mode
01004ACD     90                        NOP
01004ACE     E9 A4320000               JMP NOTEPAD.01007D77
01004AD3     90                        NOP


well, you could always modify urself using the ollydebug wink.gif
for those who have no idea what i am talking about, u can download the mod notepad from here icon_idea.gif (modified windows xp notepad)


disclaimer : i am not responsible if you OS crashed or etc etc or virus or spyware or etc etc.

This post has been edited by sleepsleep: Nov 9 2006, 12:47 AM


Attached File(s)
Attached File  NOTEPAD.zip ( 32.64k ) Number of downloads: 47

 

Change to:
| Lo-Fi Version
0.0219sec    1.32    6 queries    GZIP Disabled
Time is now: 19th December 2025 - 01:46 AM