Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4183880

Appletviewer calls locale-dependent method for HTML tags; breaks for Turkish

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.4.0
    • 1.1.6
    • tools
    • beta
    • generic
    • generic



      Name: mf23781 Date: 10/23/98


      PRECIS
      ------
      This problem concerns the conversion of HTML syntax to lowercase as performed in the apple browser. The conversion is locale-specific, and in the given example involves Turkish. Here conversion of 'I' (uppercase i) to lowercase gives an 'i' without a dot which does not match an 'i' with a dot.

      POTENTIAL SCOPE
      ---------------
      The problem could be more pervasive, dependant upon language and conversions. The lowercase conversion is applied to user-defined parameters, and could cause strange (but avoidable) problems wherever there is a case conversion ambiguity. (eg WASSER (german) ---> wasser, but WEIS ---> wei<funny character like a 'B' with a tail>.

      TESTCASE
      --------
        
      To demonstrate this problem you first need a system configured for Turkish! On our OS/2 JVM it is enough to simply do a "SET LANG=TR_TR" before invoking the appletviewer - on Win32 or Unix systems it may be a little more involved.

      Then pick any of the demo applets supplied with JVM (something like "NervousText" is a nice simple one). Edit the "example1.html" file so the <applet> tag parameters WIDTH and HEIGHT are in UPPERCASE, which is perfectly valid. Now do "appletviewer example1.html" and the applet will not start - it complains that the "width" attribute is missing.


      ANALYSIS
      --------
      If the <APPLET> tag parameters are specified in UPPERCASE in an HTML file the applet can fail to run on a Turkish system. This failure is seen using the appletviewer application, I'm afraid I can't figure out whether this problem is specific to ppletviewer or would also occur in browsers that tried to run the applet.

      The problem occurs because of the way an uppercase letter "I" is turned into lowercase in the toLowerCase(Locale) method of java/lang/String.java. This method has some special-case code if the locale is Turkey to map the "uppercase dotless i" to "lowercase dotless i" and "uppercase dotted i" to "lowercase
      dotted i".

      When the applet tag is parsed the applet parameters are put into a hashtable in lowercase (using the String.toLowerCase method). Thus in Turkish if the "WIDTH" parameter is specified in uppercase in the HTML it goes into the hash table with the "I" lowercased to a "dotless i". The appletviewer then does a
      getParameter("width") (lowercase "width" with a "dotted i" of course) and fails to find a match.

      I believe these <APPLET> tag parameters (and possibly the stuff associated with the <PARAM> tag too) are defined to be US-English strings and should therefore not undergo this special Turkish lowercasing.


      PLATFORM
      --------
      This is reproducible on an OS/2 machine, but the code where the bug appears is generic. This bug was detected here (IBM JTC) and analysed by an experienced developer familiar with the code.

      ======================================================================

            duke J. Duke
            miflemi Mick Fleming
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: