comparison src/utf8.cc @ 1098:614b1d02e6c3

Refactor: isolate calls to utf8 functions into a single source file.
author corvid <corvid@lavabit.com>
date Fri, 15 May 2009 22:08:10 -0400
parents
children 94b9265663f6
comparison
equal deleted inserted replaced
1097:4be83aec27bd 1098:614b1d02e6c3
1 /*
2 * File: utf8.c
3 *
4 * Copyright (C) 2009 Jorge Arellano Cid <jcid@dillo.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 */
11
12 #include <fltk/utf.h>
13
14 #include "utf8.hh"
15
16 // C++ functions with C linkage ----------------------------------------------
17
18 /*
19 * Write UTF-8 encoding of ucs into buf and return number of bytes written.
20 */
21 int a_Utf8_encode(unsigned int ucs, char *buf)
22 {
23 return utf8encode(ucs, buf);
24 }
25
26 /*
27 * Examine first srclen bytes of src.
28 * Return 0 if not legal UTF-8, 1 if all ASCII, 2 if all below 0x800,
29 * 3 if all below 0x10000, and 4 otherwise.
30 */
31 int a_Utf8_test(const char* src, unsigned int srclen)
32 {
33 return utf8test(src, srclen);
34 }