PowerShell in Unicode, Windows 8 RP and Windows Server 2012 RC

PowerShell 3.0 under Windows 8

I was testing our software with latest version of Microsoft Windows — Windows 8 Release Preview and Windows Server 2012 Release Candidate (Windows Server 2012 RC Datacenter).

There was some changed behavior in very specific cases for some rarely used Windows API. I also found some race conditions, that showed up in Windows 8, but all this was trivial to fix.

The strange problem appeared in capturing console output from PowerShell in UTF-8 or Unicode (UTF-16). We are using CreateProcess Windows API function with redirected pipes. And strangely all output is converted from Unicode to ASCII. We are using OutputEncoding UTF-8:
[Console]::OutputEncoding = [Text.Encoding]::Utf8See example here: Unicode in PowerShell – example #2.

Windows 8 is using a new version of PowerShell — v3, so I tried to use compatibility command line switch -version 2.0, and this solved the problem.

Most probably this is a bug in Microsoft PowerShell — PowerShell somewhere is converting all output to ASCII. The question remains, will this be fixed in RTM or we will be unable to use Unicode output in PowerShell v3.

P.S. Currently I am unable to test this under Windows 8 RTM or Windows Server 2012 RTM, because for MSDN subscribers, Windows 8 and 2012 will be available on August 15, 2012.

Visual Studio Form Editor: To prevent possible data loss before loading the designer, the following errors must be resolved

This is not the first time. I have seen this error message in the past (probably multiple times), and every time I look to this error and I do not understand, why it appeared and how to fix it. I read the text, projects not referenced, projects have been built… wait… yes, projects must be built, otherwise Inherited Forms can not be shown. Building the projects with base classes solved the problem.

Visual Studio Form Editor: To prevent possible data loss before loading the designer, the following errors must be resolved: The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following clasess in the file: MyClass.cs — The base class MyBaseClass.cs could not be loaded. Ensure the assembly has been referenced and that all projects have been built.

Spammed by WordPress comment stealing bot with Facebook profile

Some time ago (1/2 year, may be 1 year) strange comments started to appear in our WordPress comment moderation queue. They all contained some random comments from random places, they all had the similar URL:
http://www.facebook.com/profile.php?id=XXXXXXXXXXXXXXX
where XXXXXXXXXXXXXXX is profile ID, that is changing from one comment to another. I didn’t click on the fake profiles, do not have time to research who are behind this.

Today regular chunk of SPAM in moderation queue, again with fake Facebook profiles, again bypassed CAPTCHA somehow (Chinese clickers perhaps), but one particular comment grabbed my attention. It is comment from post about old tabled unboxing.
Here is a comment:

Author : Bagas (IP: 92.99.196.92 , 92.99.196.92)
E-mail : rkleinschmidt@SOMETHING–HEALTH–related–WAS–here.org
URL : http://www.facebook.com/profile.php?id=XXXXXXXXXXXXXXX
Whois : http://whois.arin.net/rest/ip/92.99.196.92
Comment:
I buy few unit from amazon , at first i think the $199 is good deal , but actllauy this player is worst , the touch screen really slow and hard to scroll , and the app , i think all junk app , please consider don’t think $199 is a good deal , better u add another bucks for really goods item.

The strange thing is that this comment seems like absolutely legitimate user commenting on Archos tablet. Yes, touch screen is slow, there are junk apps, etc.

I did a quick Google search, and instantly found original site, where this comment was stolen:
http://www.yugatech.com/personal-computing/archos-7-home-tablet/

It is blog post about Archos tablet. And comment is from “June 25, 2010 at 5:32 pm”. It is also running on the WordPress engine.

So the theory:

  • The Comment Stealing BOT (CSB) finds random WordPress blog;
  • CSB then finds some random posts;
  • CSB somehow searches the internet, using keywords from my blog post;
  • CSB finds some WordPress blog and grabs some random comments;
  • Sometimes it succeeds, and comment looks like real user post;
  • It tries to promote some Facebook pages;
  • If you are managing multiple blogs, you spot this pattern instantly.

Of course other WordPress users are noticing this too: