Re: writing (char) 129 to file



Oliver Wong wrote:
"Thomas Fritsch" <i.dont.like.spam@xxxxxxxxxxx> wrote in message news:newscache$s200vi$0t7$1@xxxxxxxxxxxxxx
BTW: I suspect, that Sun now regrets the Java-1.0 design-decision that a
char is 2 bytes long.

Yes. They allude to this regret in the Javadocs too: http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Character.html

- Oliver


I think that given the situation, we came up with the most reasonable solution for 1.5. Unicode had evolved past 65k characters for a long time...frankly, we ignored it as long as possible. With 1.5, the demand was overwhelming...and legitimate, real characters had shown up in the Unicode 4.0 specification. We had to find some way to move Java up to the new 4.0 spec. We considered practically everything...making a new char32 type, using ints exclusively as characters, changing the definition of char to be 32 bits wide, etc. Finally, we have what we have now...after much debate. It isn't perfect, but it works.

Best of luck,
John O'Conner
.



Relevant Pages

  • Re: heeeeeeeeeeeeeeeellllllllllllllppppppppppppppppppppp
    ... This means that if you develop the bad habit of using char * (left over ... It usually takes me five minutes to create a Unicode version of any of my apps, ... BOOL and bool are different data types. ... can be up to MAX_PATH characters). ...
    (microsoft.public.vc.mfc)
  • Re: passing char * to dll
    ... char is a single byte thing so there are only 256 different possible values. ... This makes it difficult to have fonts of more than 256 characters. ... Unicode is a way of having all possible characters (latin, chinese, arabic, ... The idea was that you write your code using TCHAR everywhere and TCHAR is ...
    (microsoft.public.vc.mfc)
  • Re: Schleife =?iso-8859-15?Q?=FCber_die_Codepoints?=
    ... The char data type are based on the original Unicode specification, which defined characters as fixed-width 16-bit entities. ... Characters whose code points are greater than U+FFFF are called supplementary characters. ...
    (de.comp.lang.java)
  • Re: Help with UNICODE.
    ... Find every occurrence of 'char' in your code. ... because tcslen is now the length in CHARACTERS, and WriteFile wants a length in BYTES. ... Here you really do have to use char, and convert the 8-bit data to Unicode ... You can also use CStringA to hold 8-bit data and pass it around to other CStringA values. ...
    (microsoft.public.vc.mfc)
  • Re: passing char * to dll
    ... char is a single byte thing so there are only 256 different possible values. ... This makes it difficult to have fonts of more than 256 characters. ... Unicode is a way of having all possible characters in a single set. ... To make the transition as painless as possible Microsoft invented the transitional type TCHAR. ...
    (microsoft.public.vc.mfc)