swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
    Related Concepts   Other Library Functions  
function  

utf8.code-point

 
 

Library: Character encodings, UTF-8 (OMUTF8 )
Import: omutf8.xmd
Return type: Integer
Returns: 

Integer value corresponding to the specified UTF-8 character.


Declaration

  define integer function utf8.code-point
    of  value stream utf8-string


Purpose

You can use utf8.code-point to convert a string containing a single UTF-8 character to the character number it encodes.

If the string does not consist of a single UTF-8 encoded character, the character number of the Unicode Replacement Character (U-FFFD) is returned instead.

The following program converts a UTF-8 encoded file to a long character encoding (2 bytes for every character):

  import "omutf8.xmd" prefixed by utf8.

  process
      submit file #main-input

  find utf8.char => char
      output "2f0b" % utf8.code-point of char

      Related Concepts
   Character set encoding
 
Other Library Functions
   utf8.char
   utf8.code-point
   utf8.encoding
   utf8.multi-byte-char
   utf8.omutf8-version
   utf8.single-byte-char
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:45:57 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.