SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2006
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    AJAX, IIS, UTF-8 Question

    Hi everyone. I'm doing my best to learn about Ajax and development of web apps using this architecture. I recently read this:

    "Ajax uses UTF-8. Normal forms are sent using the encoding of the parent page. Thus a SJIS encoded page will default to sending form content encoded in SJIS. Ajax submitted forms on the other hand will be sent as UTF-8. If for some strange reason, UTF-8 is not the character set of choice for the server, this will require a solution such as the server recognizing and translating UTF-8 responses to a desired character encoding."

    The line that immediately jumped out at me was this one:

    "If for some strange reason, UTF-8 is not the character set of choice for the server, this will require a solution such as the server recognizing and translating UTF-8 responses to a desired character encoding."

    Does this mean that IIS or Apache have to be explicitly setup to handle UTF-8? If so, how? I've never had to deal with since I've not worked on international sites so this is new to me.

    I know I can set the charset to UTF-8 for a specific page via the following line:

    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

    but again, I'm concerned about my web server not being configured to handle that.

    Also, what about SQL Server? Does that have to be configured in some special way if I'm receiving AJAX data in UTF-8?

    Thanks,

    Rey

  2. #2
    SitePoint Wizard chris_fuel's Avatar
    Join Date
    May 2006
    Location
    Ventura, CA
    Posts
    2,750
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I generally recommend utf8 across the board, as it makes things easy in the long run when dealing with character encoding. That said, I think it's somewhat silly to have an sjis encoded page. If you REALLY need to:

    http://us2.php.net/iconv

    can help you with encoding conversion. In the end, when the server says "Here, have this", it's up to the browser to say "wee, utf8, lemme decode and grab some fonts!". As far as the server goes, those generally don't have utf8 as default (multibyte = more store space). I'm not sure really how to enable that, as I've never had to store localized data, so you'll want to check your appropriate server documentation on setting character encoding for tables.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •