package camlimages

  1. Overview
  2. Docs
Image processing library

Install

dune-project
 Dependency

Authors

Maintainers

Sources

camlimages-5.0.4.tar.bz2
sha256=1c9a68bdc3d348c9f859d490dadf384926213e47a584159832f7fc4a20242865
md5=1ddba74d210b86a899b5d6565f45c2dc

doc/src/camlimages.core/jis_unicode.ml.html

Source file jis_unicode.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(***********************************************************************)
(*                                                                     *)
(*                           Objective Caml                            *)
(*                                                                     *)
(*            Jun Furuse, projet Cristal, INRIA Rocquencourt           *)
(*                                                                     *)
(*  Copyright 1999-2004,                                               *)
(*  Institut National de Recherche en Informatique et en Automatique.  *)
(*  Distributed only by permission.                                    *)
(*                                                                     *)
(***********************************************************************)

(* $Id: jis_unicode.ml,v 1.1 2007/01/18 10:29:57 rousse Exp $ *)

open Jis_table

let encode s = (* they must be pure EUC string! *)
  Array.init (String.length s / 2) @@ fun i ->
    let h = (Char.code s.[i * 2] - 0x80)
    and l = (Char.code s.[i * 2 + 1] - 0x80) in
    let pos = ((h - 0x21) * 94 + (l - 0x21)) * 2 in
    int_of_char table.[pos] * 256 + int_of_char table.[pos+1]
OCaml

Innovation. Community. Security.