RE: German characters not correct in output webform

From: Addison Phillips [wM] (aphillips@webmethods.com)
Date: Tue Jan 13 2004 - 12:48:56 EST

  • Next message: Dean Snyder: "Cuneiform - Dynamic vs. Static"

    German characters not correct in output webformHi Bert,

    This is a common problem.

    When you do a form submit (POST or GET of data to the server), the browser encodes the characters being sent using the character encoding that the page uses. In your case, from the examples you sent, this encoding is Unicode UTF-8. UTF-8 is a multibyte encoding of Unicode in which non-ASCII characters take two or more bytes. In this case, the German accented characters each take two bytes.

    When the server receives the data, it decodes the original bytes sent by the browser. The problem is: what encoding should be used to interpret the bytes? For historical reasons, most Web servers (include J2EE, .NET, Apache/Tomcat, etc.) default to using ISO-8859-1 (Latin-1), a single byte Western European encoding. This is what is happening in your case: each UTF-8 byte is being treated as a single character, leading to the corruption you are experiencing. You can see that each German character is interpreted as a sequence of two bytes.

    To fix your problem you must change your server side configuration to interprets the bytes sent using the same encoding that the form uses (UTF-8 in this case). This has nothing to do with your Javascript. What exactly to do depends on the technology of your web server. There are too many of these to list here, but you should be able to do a little searching to find the answer (or write back off list and I can probably point you to the documentation).

    You might want to be aware of the W3C's Internationalization mailing list (See http://lists.w3.org/Archives/Public/www-international/) and of the FAQs at http://www.w3.org/International/geo (alas, the FAQ on this topic hasn't been published yet!)

    Best Regards,

    Addison
    Addison P. Phillips
    Director, Globalization Architecture
    webMethods | Delivering Global Business Visibility
    http://www.webMethods.com
    Chair, W3C Internationalization (I18N) Working Group
    Chair, W3C-I18N-WG, Web Services Task Force
    http://www.w3.org/International

    Internationalization is an architecture.
    It is not a feature.

      -----Original Message-----
      From: unicode-bounce@unicode.org [mailto:unicode-bounce@unicode.org]On Behalf Of Bert Kemner
      Sent: lundi 12 janvier 2004 22:38
      To: 'unicode@unicode.org'
      Subject: German characters not correct in output webform

      Hi,
        
       I've a problem with a Javascript form on a german website.
       (http://informationservices.swets.de/web/show/id=47553)
       The input of the form contains german characters.
       But the output (which is generated by submitting the form) does not
       display those characters (see example beneath). My first reaction to
       this problem is that Unicode somehow does not translate these german
       characters to Windows (Outlook).
        
       Example form output:
       Form: Kontaktformular
       Sender: Receiver: info@de.swets.com
       Insertdate: 2/12/2003
        
       Vor- und Zuname:: Birgitta Mühe
       Firma / Institution:: Ã?ffentliche Bücherei Mainz
       Berufsbezeichnung::
       E-Mail-Adresse:: birgitta.muehe@stadt.mainz.de
       Telefonnummer::
       Ihre Fragen und Anregungen:: Wir interessieren uns für eine
       Abonnement der Print-Ausgabe der britischen Tageszeitung "Times". Ist
       dies über Sie möglich und wenn ja zu welchen Konditionen.
       (Preis, wann wird zugestellt? ...)
        
       Can you help me with this, or suggest something?
        
       I really appreciate your help.
        
       Kindest regards,
        
       Bert Kemner,
       webmaster,
       Swets Information Services,
       Lisse,
       The Netherlands

      Bert Kemner
      Webmaster

      Swets Information Services
      P.O.Box 830
      2160 SZ Lisse
      Heereweg 347B
      2161 CA Lisse
      The Netherlands
      T +31 (0)252 435 241
      F +31 (0)252 415 888
      E bkemner@nl.swets.com
      www.swets.com



    This archive was generated by hypermail 2.1.5 : Tue Jan 13 2004 - 13:52:12 EST