How to Paste text into .txt file with Unicode support?
How to Paste text into .txt file with Unicode support?
Hi,
When i copy some text and -> Paste Special -> Paste Text Into New File
It create a ANSI encoded text file.
How can I paste into a Unicode text file? (reason, some Unicode is not supported in ANSI).
thanks
When i copy some text and -> Paste Special -> Paste Text Into New File
It create a ANSI encoded text file.
How can I paste into a Unicode text file? (reason, some Unicode is not supported in ANSI).
thanks
Re: How to Paste text into .txt file with Unicode support?
I tried it on the latest beta with:
in the clipboard and the file contains these chars afterwards...
EditPad Pro states: UTF-16LE BOM...
Code: Select all
正體字/繁
EditPad Pro states: UTF-16LE BOM...
One of my scripts helped you out? Please donate via Paypal
Re: How to Paste text into .txt file with Unicode support?
Tested with highend's text:
- pasted it into command line: shown OK
- pasted/special into New File
- Preview it: OK
- Raw View: garbage (but says: UTF-16LE file, Ascii view)
- check per editor: OK
Didn't expect that Raw View shows it as ASCII - but as it says so I'd say it's correct.
- pasted it into command line: shown OK
- pasted/special into New File
- Preview it: OK
- Raw View: garbage (but says: UTF-16LE file, Ascii view)
- check per editor: OK
Didn't expect that Raw View shows it as ASCII - but as it says so I'd say it's correct.
Win11 Pro 23H2 Gerrman
-
- Site Admin
- Posts: 63620
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: How to Paste text into .txt file with Unicode support?
Raw is raw: it shows the bytes -- in this case as-if-they-were-ASCII.
FAQ | XY News RSS | XY Bluesky
Re: How to Paste text into .txt file with Unicode support?
Yes, but sometimes I need a quick look at a file that happens to be UTF, but that's not a Previewed filetype. (.gpx, for example, but others, too.)admin wrote:Raw is raw: it shows the bytes -- in this case as-if-they-were-ASCII.
Here it would be very convenient if I could switch in Raw View between Hex, ASCII, and UTF, to be able to read the contents. Now I always must open it in some editor, just to have a readable view.
So I'd wish a radio button instead of the Hex selection field.
Win11 Pro 23H2 Gerrman
-
- Site Admin
- Posts: 63620
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: How to Paste text into .txt file with Unicode support?
I see, maybe later.
FAQ | XY News RSS | XY Bluesky
Re: How to Paste text into .txt file with Unicode support?
Is it possible to have a setting or a hack, to always create a UTF-8 file when pasting to a new text file, instead of an ANSI one?
Now I have to Paste to a new file, open it with an editor, change the encoding to UTF-8, and re-save.
(Which beats the purpose of this shortcut since it has the same or even more steps than to just open the editor, paste and save..
)
I hope that I'm not missing a very obvious solution somewhere..
P.S. Sorry for the necro (and hijacking), but this thread was very close to my request..
Now I have to Paste to a new file, open it with an editor, change the encoding to UTF-8, and re-save.
(Which beats the purpose of this shortcut since it has the same or even more steps than to just open the editor, paste and save..

I hope that I'm not missing a very obvious solution somewhere..

P.S. Sorry for the necro (and hijacking), but this thread was very close to my request..
Check my free programs here..
Re: How to Paste text into .txt file with Unicode support?
Code: Select all
writefile("Clipboard-" . formatdate(, "yyyymmdd") . ".txt", <clp>, , "utf8");
One of my scripts helped you out? Please donate via Paypal
Re: How to Paste text into .txt file with Unicode support?
Thank you @highend for your code, but I was thinking more of a setting to the native Ctrl+Alt+V shortcut or the "Paste Text into New File" menu action.
I can try and create a CB with your code, and then somehow assign it the Ctrl+Alt+V keyboard shortcut (I hope that the shortcuts work if the CB is not visible)..
I can try and create a CB with your code, and then somehow assign it the Ctrl+Alt+V keyboard shortcut (I hope that the shortcuts work if the CB is not visible)..

Check my free programs here..
Re: How to Paste text into .txt file with Unicode support?
There is this great mixup about Unicode<>utf-8, but from what I understand, if I copy some text that should be Unicode, like this: "διεθνές κείμενο", and paste it with ctrl+alt+V, I get an ANSI text file.
I couldn't find a way to copy anything and get a UTF-8 text file with paste..

Check my free programs here..
-
- Site Admin
- Posts: 63620
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: How to Paste text into .txt file with Unicode support?
No. If you ctrl+alt+V "διεθνές κείμενο", you (should!) get a UTF-16LE BOM file.
FAQ | XY News RSS | XY Bluesky
Re: How to Paste text into .txt file with Unicode support?
Well, not here..

OS: Windows 10 Pro, 64-bit, Version 22H2, Build 19045.3324 (10.0), .NET v4.8.09037
Time Zone: GTB Standard Time, GTB Daylight Time UTC Offset: +02:00
Windows UI Language: English LongPathAware: No
Themes: Yes (Dark) RealSystem32: Yes User Role: User
System / Thread Locale ID: 1032 (el-GR) / 1032 (el-GR)
Default ANSI Code Page: 1253 (ANSI - Greek)
Active ANSI Code Page: 1253 (ANSI - Greek)
Default OEM code page: 737 (OEM - Greek 437G)
Active OEM Code Page: 737 (OEM - Greek 437G)
DBCS Code Page: No
Main Contents Font: Segoe UI 9,75
Buttons & Labels Font: Segoe UI 9,75
Check my free programs here..
-
- Site Admin
- Posts: 63620
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: How to Paste text into .txt file with Unicode support?
Try these and post the results:
Code: Select all
charview "διεθνές κείμενο";
Code: Select all
echo isunicode("διεθνές κείμενο", 0);
Code: Select all
echo isunicode("διεθνές κείμενο", 1);
FAQ | XY News RSS | XY Bluesky
Re: How to Paste text into .txt file with Unicode support?
This is what I get with ctrl+alt+V
Last edited by noembryo on 21 Feb 2025 11:25, edited 1 time in total.
Check my free programs here..