Scott Hanselman

How to convert a text file with a specific Codepage to UTF-8 using Visual Studio .NET

November 15, '06 Comments [6] Posted in Internationalization
Sponsored By

A partner recently sent me a RESX (.NET Resource) text file in Hebrew for a project I'm working on. When I opened it, it looked really bad, as seen in the screenshot below.

I assumed this was a classic ANSI vs. UTF-8 problem, so I tried to do a quick conversion within Notepad2, but that resulted in nonsense East Asian characters from all over:

This means that the original file was in fact in ASCII, but just not using an English codepage. I've talked a little about codepages in the Hanselminutes Podcast on Internationalization in the past and regularly point folks to the Joel on Software article on Internationalization.

In a nutshell, a codepage is a "view" that someone can use to look

Ordinarily, I recommend that everyone (including Israelis) use Unicode/UTF-8 to represent their Hebrew characters, however, a lot of folks who write Hebrew use the Windows 1255 codepage for their encoding. (BTW, go here, scroll down, and bask in the glory of this reference site.)

So, how do I convert from one codepage to another, or in my case, from Hebrew 1255 to UTF8?

We start with Visual Studio.NET.

  • From the File menu, select Open to bring up the dialog. Note that you'll have to select a file before the Open button is un-grayed.
  • Select the tiny down-arrow on the right side of the Open button and select "Open With..."
    • -5 points for obscure UI design here
  • Next, select "Source Code (Text) Editor with Encoding." The With Encoding part is crucial, otherwise the next dialog won't appear.
  • From the Encoding Dialog, select the source document's encoding - in my case, that's Hebrew 1255.
    • -10 points for obscure UI design here.
  • At this point the document should appear correctly in Visual Studio.NET. Now, reverse the process by selecting File|Save As and clicking the tiny down arrow on the Save button, and selecting both the desired Encoding and Line Endings.

Now you've successfully normalized your document to UTF-8, and it should be usable as a RESX file or whatever you like. Here's that same document loaded into Notepad2.

And it was Good.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Best Outlook 2007 Improvement - Include Calendar

November 15, '06 Comments [6] Posted in Reviews
Sponsored By

Sometimes when you download multi-gig ISOs and have trouble installing, you look for little features that "make it all worthwhile." Little usabilty stuff, you know.

Everyone's raving about the Ribbon interface, and the Outlook "To-Do Bar" but my choice for the best new feature in Office, and Outlook in particular?

Check out the "Include" section of the Outlook New Message Ribbon...this makes it all worthwhile. It's bloodly brilliant, and it's about time. Click "Business Card" and you can add your VCard in one click. Click Signature and you can add any of your email sigs in replies or mesages where it was removed.

And the very best option? Include Calendar - a flexible little item that lets you include not only an ICS attachment with your free time, but also an HTML rendered schedule with your Availability and/or Details.

Sure, we all wish there was a cross-platform universal Free/Busy service, but until Google does it ;) we have this very clean, elegant and simple solution to one of life's daily irritations. Fabulous.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Office 2007 won't upgrade from a prerelease version of the 2007 Office System - Office 2007 Setup Spelunking

November 14, '06 Comments [21] Posted in Reviews | Tools
Sponsored By

I'm back to work and trying to install the Released version of Office 2007, and am greeted by this friendly dialog, announcing that

"Setup is unable to proceed due to the following error(s): The 2007 Microsoft Office system does not support upgrading from a prerelease version of the 2007 Microsoft Office system. You must first uninstall any prerelease versions of the 2007 Microsoft Office system products and associates technologies."

Hm...considering that I've never installed Office 2007 Beta on this machine, and I think this would qualify as a very poor error message that would totally stump my Mom.

According to the FAQ online, this is indicative of having the Office 2003 Web Components from a previous version is installed. Of course! Why didn't I think of that?

Well, this would be fine if it were true in my case. After removing the Office 2003 Web Components via Add/Remove Programs the problem persists. I doubt my OWC components are from a beta of Office.

OK, so what is the setup looking for, and finding, that is causing it to bork like this?

So, I fired up Filemon and Regmon from SysInternals and begin to dig.

FileMon indicated that the setup log file was here:

9:58:15 AM setup.exe:5000 IRP_MJ_WRITE C:\DOCUME~1\shanselm\LOCALS~1\Temp\SetupExe(200611140958151388).log SUCCESS Offset: 0 Length: 78

...and inside that file was

Catalyst beta product conflict check failed. Office Beta product conflict is detected on the computer, productcode={30120000-006E-0409-0000-0000000FF1CE}

...which resulted in this informative message:

...which is a shame, because looking in the registry for 30120000-006E-0409-0000-0000000FF1CE showed me that I some how got the "Office Shared MUI" on my system.

However, it doesn't show up in Add/Remove Programs:

But it does show up when I run the very fabulous MyUnInst from Nirsoft (a must-install tool) along with a few other things like "Microsoft Office Proof," which I assume is the Spellchecker and Grammar tools. I'm not sure WHO installed those or when it happened. Pressing Ctrl-U on these items within MyUnInst started the uninstall process.

Once I removed these strange little things, Office 2007 started to install as expected.

Not the best OOBE (Out Of Box Experience), but I think we can assume my Mom isn't running any Beta stuff like this, so hopefully she won't have a similar experience.

A few interesting asides, if you poke around on the Office 2007 installation media:

  • In the root is a folder called Rosebud - this is apparently the codename for Microsoft's new Web Folders implementation, apparently to better support WebDAV and SharePoint 2007. It seems to be an OLEDB Provider for Internet Publishing.
  • In one of the setup.xml files there's a line like: <Option Id="OneNoteFiles" DefaultState="Local" DisallowAbsent="no" DisallowAdvertise="no" PreReq="IsEnterprise; IsEnterpriseR; IsHomeStudentR; IsOneNoteHS; IsOneNote; IsOneNoteR; IsUltimate; IsUltimateR; IsMondo"/> and I wonder if "Mondo" is some version of Office that is "bigger and better" than Ultimate?

UPDATE: I got a note from a Microsoft Insider who clued me into why this might have happened to me. Seems I installed a beta of Microsoft Expression Web a while back, and it shares this MSI with other Office componentry. Good to know.

He also shares: "Mondo isn’t some super-secret better-than-best product. It’s an internal-only product we use for test purposes. All current and planned Office suites can be found online at http://office.microsoft.com/en-us/products/FX101635841033.aspx"

Interesting stuff.

UPDATE #2: Be sure to enter your Product Keys when they ask you. Even though you're not required to enter your Product Key until later, if you try to do anything that involves one of the Office 2007 programs accessing the Internet without first entering your Product Key, like downloading a template within Publisher, Word or Excel, you will see this dialog:

Clicking "Get Genuine" will launch your default browser (mine is Firefox, which this website doesn't support, and I got caught in a Javascript page-reload loop and the page reloaded over and over again, so I pasted the URL into IE manually) and tell you basically the same thing:

So, I went back into those two programs and entered my Product Key, which interestingly enough after entering, told me to "Install Now" again. I did, then visited the Genunie Validation page again.

Close, but looks like I need to activate first. So, I closed both apps, and launched them again and was prompted to activate:

...and I was told it was cool. Then I visted the page again:

...and now I'm told that my MSDN key "has been identifed as a false key used with counterfeit copies of Office." That's weird, since I just got it off MSDN and it was just used to activate Office and Visio. This isn't good. I tried again in OneNote:

Now I'm told that I'm not only counterfeit, but I've also used the activation key too many times. I'm not sure which it is, as I'm using the same key (the only key) for all these activations...Office, Visio, OneNote, InfoPath. I thought that one key in Office was one key for the suite, not each app outside of Office Professional. I'm still not able to get any templates off the Internet or download product updates.

Moral: Just enter your Product Key when they ask.

At this point, even though the website says that my copy of InfoPath is not activated and is, in fact, not legit, it does work fine. My copy of OneNote however, will not activate. According on the MSDN Product page, "This product key will activate 10 PCs" - I've only used this key on the one PC, and I just got it today. It's also confusing because MSDN lists two kinds of keys, one for Office 2007 Professional and one for "Office 2007 Desktop Programs."

I'm not sure what to do now. This sucks.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Surfing the Internet at 35,000 feet and the Death of Connexion by Boeing on Lufthansa

November 13, '06 Comments [7] Posted in Reviews
Sponsored By

The baby is fed, and he and Mo are asleep next to me. I'm in Row 24 on Lufthansa flying from Frankfurt, Germany to Portland, OR (we had a 14 hour layover in Frankfurt after flying in from Barcelona) and I'm blogging from the plane.

They've announced the end/death of this service but since October 1st, they are having a special deal right now where wireless 802.11 Internet from the plane is free. It's the last gasps of a doomed business model. The (at least, us) had a good run of nearly two years of wireless access on long-haul flights.

It's a fine service and a darned shame. It's a little slow on the turnaround time which makes sense given the satellites involved:

>ping www.hanselman.com

Pinging hanselman.com [66.129.71.242] with 32 bytes of data:

Reply from 66.129.71.242: bytes=32 time=713ms TTL=104
Reply from 66.129.71.242: bytes=32 time=731ms TTL=104
Reply from 66.129.71.242: bytes=32 time=729ms TTL=104
Reply from 66.129.71.242: bytes=32 time=731ms TTL=104

...but once you get a download started it's not bad at all. I'm off now to download Office 2007!

I wonder if cell phone technology would ever work up this high? Was Connexion doomed because of timing or pricing?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Hanselminutes Podcast 40 - Architecture (TechEd Barcelona)

November 11, '06 Comments [0] Posted in Podcast
Sponsored By

My fortieth Podcast is up.  In this one, Carl and I chat about Architecture, for the first time in person, in the halls of TechEd Europe in Barcelona.

We're listed in the iTunes Podcast Directory, so I encourage you to subscribe with a single click (two in Firefox) with the button below. For those of you on slower connections there are lo-fi and torrent-based versions as well.

Subscribe: Feed-icon-16x16 Subscribe to my Podcast in iTunes

Links from the show are also always on the show site, although this show had no links to speak of. Do also remember the archives are always up and they have PDF Transcripts, a little known feature that show up a few weeks after each show.

Our sponsors are CodeSmith Tools, /nsoftware and the .NET Dev Journal.

There's a $100 off CodeSmith coupon for Hanselminutes listeners - it's coupon code HM100. Spread the word, now's the time to buy. This coupon is good for the CodeSmith Professional With 1 Year Premier Support option.

As I've said before this show comes to you with the audio expertise and stewardship of Carl Franklin. The name comes from Travis Illig, but the goal of the show is simple. Avoid wasting the listener's time. (and make the commute less boring)

  • The basic MP3 feed is here, and the iPod friendly one is here. There's a number of other ways you can get it (streaming, straight download, etc) that are all up on the site just below the fold. I use iTunes, myself, to listen to most podcasts, but I also use FeedDemon and it's built in support.
  • Note that for now, because of bandwidth constraints, the feeds always have just the current show. If you want to get an old show (and because many Podcasting Clients aren't smart enough to not download the file more than once) you can always find them at http://www.hanselminutes.com.
  • I have, and will, also include the enclosures to this feed you're reading, so if you're already subscribed to ComputerZen and you're not interested in cluttering your life with another feed, you have the choice to get the 'cast as well.
  • If there's a topic you'd like to hear, perhaps one that is better spoken than presented on a blog, or a great tool you can't live without, contact me and I'll get it in the queue!

Enjoy. Who knows what'll happen in the next show?

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.