Next: , Previous: Selecting a Representation, Up: Non-ASCII Characters


33.4 Character Codes

The unibyte and multibyte text representations use different character codes. The valid character codes for unibyte representation range from 0 to 255—the values that can fit in one byte. The valid character codes for multibyte representation range from 0 to 524287, but not all values in that range are valid. The values 128 through 255 are not entirely proper in multibyte text, but they can occur if you do explicit encoding and decoding (see Explicit Encoding). Some other character codes cannot occur at all in multibyte text. Only the ascii codes 0 through 127 are completely legitimate in both representations.

— Function: char-valid-p charcode &optional genericp

This returns t if charcode is valid for either one of the two text representations.

          (char-valid-p 65)
               => t
          (char-valid-p 256)
               => nil
          (char-valid-p 2248)
               => t
     

If the optional argument genericp is non-nil, this function returns t if charcode is a generic character (see Splitting Characters).