Jump to content

Forum formatting survives WordPad's Paste Special > Unformatted Text...??


Guy_
 Share

Recommended Posts

I am seeing a weird result when pasting some lines from the forum into WordPad, even while using Paste Special > Unformatted Text ...

Example: copy the reply from the first post here:

Go to WordPad and Paste Special > Unformatted Text (Ctrl + Alt + v)
Result is two fonts instead of one "unformatted" (I took out the blank lines):

ZKNNCjX.png

If you analyze the .rtf code, it has this font command in it: {\f1\fnil\fcharset134 SimSun;}}

(1) Why is that there, or how can it even get through Paste Special?
Is it really there, or is it a one-in-a-million text combo that triggers WordPad formatting?

(2) Speaking in general, if you would run this through AutoIt, or you copied it with AutoIt, how would you prevent it?
What could you filter out?
Is this some kind of control code that can be filtered simply, or would you have to do a regex for these patterns?

Thanks  :)

Edited by Guy_
Link to comment
Share on other sites

Wow, thanks for this hint!  :)

And yes, I am on Windows 7.

Would the copying from that post have "stuff" in it that I can view when I paste it in some kinda text editor mode? I'm struggling to find a way (I have Notepad++, for example).

Do you think this symbol could be a short code for WordPad that makes it apply this different font by chance...?

Like for example the /š/ you mention would trigger the SimSun font?

That seems to make some sense, but I would still be left wondering what best to check for or filter out. Like is it just that other colon, or could other stuff cause this?

I feel like it still shouldn't happen with "Unformatted Text," but maybe they corrected that for the later WordPad versions then...

Anyway, happy to have some kind of hint already :)
I will also ask on an MS forum and see what gives...

Edited by Guy_
Link to comment
Share on other sites

I can only assume the poster was using Asian keyboard or something like that.  You can view the characters in NotePad++ by copying the text in and change encoding to Ansi and you should see the odd characters, I'm fairly sure that is what triggers the SimSun font.  In IE there are a couple of other characters that are also displayed.  You can use something like the following to convert them to unicode:

$String = "And i have a easy  way to slove this problem:"
MsgBox(0,'Before', $String)
$String = BinaryToString(StringToBinary($String), 4)
MsgBox(0,'After', $String)

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...