Display Unicode Characters on the Windows Console

Even in today’s mostly-Unicode world on Windows, the console (i.e. cmd.exe) still defaults to using OEM code pages (i.e. multibyte characters).  To set the console to Unicode mode, use the following code:

#include <fcntl.h>
#include <io.h>
#include <stdio.h>

int main(void)
{
   _setmode(_fileno(stdout), _O_U16TEXT);
   wprintf(L"\x043a\x043e\x0448\x043a\x0430 \x65e5\x672c\x56fd\n");
   return 0;
}

This information came from two great articles by Michael Kaplan:

Always prefix a Unicode plain text file with a byte order mark

This comes from the MSDN page entitled “Using Byte Order Marks”.

Byte order mark Description
EF BB BF UTF-8
FF FE UTF-16, little endian
FE FF UTF-16, big endian
FF FE 00 00 UTF-32, little endian
00 00 FE FF UTF-32, big-endian

How to install VC++ update KB2455033

Head to the Visual C++ Team’s blog entry entitled “MS11-025 Visual C++ Update Issue“, scroll down to the section entitled “Visual Studio 2010 RTM with Windows SDK”, and follow the instructions there.  For completeness sake, here they are:

If you have Visual Studio 2010 RTM and Windows SDK 7.1 installed on an x64 machine, then the Visual Studio 2010 update (KB2455033) fails to install on your machine.

Workaround

The workaround for this issue:

  1. Go to Add/Remove Programs and uninstall the package “Microsoft Visual C++ compilers 2010 Standard x64″
  2. Try installing KB2455033 again.

Windows Phone 7 Version Information

I was working with the updated version of the Windows Phone 7 (WP7) emulator and was curious to find out what software versions were running on it.  Here is the output I got:

WP7 Version Information

For those of you who search for this kind of information, the plain text:

OS Platform: WinCE
OS Version: 7.0.7389
Silverlight Version: 3.7.10302.0

And here is the code used to generate that dialog box:

MessageBox.Show(
	"OS Platform: " + Environment.OSVersion.Platform + Environment.NewLine +
	"OS Version: " + Environment.OSVersion.Version + Environment.NewLine +
	"Silverlight Version: " + Environment.Version);

Note that when I ran this on the phone itself (without the update), it reported the following:

OS Platform: WinCE
OS Version: 7.0.7004
Silverlight Version: 3.7.10218.0

If Windows Azure Cmdlets v1.3 Won’t Install

I downloaded the latest Windows Azure Cmdlets to manage my cloud storage at http://code.msdn.microsoft.com/azurecmdlets.  However, it could find my installed Azure SDK v1.3.

If running the “C:\WASMCmdlets\startHere.cmd” fails to find the “Windows Azure Software Development Kit 1.3” on the “Detecting Required Software” screen, it is because it is looking for version 1.3.11122.0038 of the SDK. However, my installed version is 1.3.20121.1237. So, I opened the “C:\WASMCmdlets\setup\scripts\dependencies\check\CheckAzureSDK.ps1” file and changed the two “1.3.11122.0038” values to “1.3.20121.1237” and re-ran startHere.cmd.

To find out what version of the Azure SDK you have installed, look in your registry at “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Windows Azure SDK\DisplayVersion”.

Note: After writing this, I discovered that Nick Harris had also posted a solution on his blog: http://www.nickharris.net/2011/02/windows-azure-service-management-cmdlets-and-azure-sdk-refresh-feb

Load more