locked
How do I get WLW to detect the correct charset? RRS feed

  • Question

  • Hi,

    How does WLW decide which character set to use for a blog, and how can I get my blog to output the correct settings for WLW to detect?

    The problem starts with smart quotes.  They're a great idea, but when I first published a post with smart quotes to my blog, I got empty rectangles, or diamonds with question marks (depending on browser).

    The 'advanced' settings for my blog had the character set "Default (windows-1251)".  Changing this to UTF-8 and republishing fixed the smart quotes and they now properly appear in browsers.

    However, I'd really like the blog auto-detection to pick up the right character set.  I plan on others using my blog code, and I don't want to have to include instructions to say "Once WLW has auto-detected the settings, go in and correct the settings."

    I use Atom Syndication Format and Atom Publishing Protocol exclusively for WLW interaction - I don't provide any other blog APIs.  I can quite happily have my Atom code output whatever WLW needs, as far as charset definition goes.

    So - any pointers to what I need to specify?

    Many thanks,

    Geoff
    Tuesday, October 28, 2008 3:09 PM

Answers

  • Becky is correct but more commonly, we just read the charset declaration on your blog homepage. It's possible that this only works if the declaration is in a meta tag, not in HTTP headers.

    Just add this to your <head>:

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    • Marked as answer by Becky Pezely Wednesday, October 29, 2008 10:50 PM
    Wednesday, October 29, 2008 5:32 PM
    Moderator

All replies

  • Hi Geoff,

    Have you seen the Writer SDK Provider Customization API?
    http://msdn.microsoft.com/en-us/library/bb463260.aspx

    Specifically, there is a Writer manifest file that you can host on your service that tells Writer the capabilities of your blog including the character set to use.

    The option characterSet determines the character set that Writer uses for XML-RPC interactions with the weblog (the default encoding is UTF-8). Valid values for this field correspond to the “.NET Name” column in the table of Code Page Identifiers found at: http://msdn2.microsoft.com/en-us/library/ms776446.aspx

    Let me know if that helps your current situation.
    Becky Pezely, Windows Live Writer
    Tuesday, October 28, 2008 10:38 PM
  • Becky is correct but more commonly, we just read the charset declaration on your blog homepage. It's possible that this only works if the declaration is in a meta tag, not in HTTP headers.

    Just add this to your <head>:

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    • Marked as answer by Becky Pezely Wednesday, October 29, 2008 10:50 PM
    Wednesday, October 29, 2008 5:32 PM
    Moderator