1 /********************************************************************************
2 *                                                                               *
3 *                      U T F - 3 2  T e x t   C o d e c                         *
4 *                                                                               *
5 *********************************************************************************
6 * Copyright (C) 2002,2005 by Lyle Johnson.   All Rights Reserved.               *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or                 *
9 * modify it under the terms of the GNU Lesser General Public                    *
10 * License as published by the Free Software Foundation; either                  *
11 * version 2.1 of the License, or (at your option) any later version.            *
12 *                                                                               *
13 * This library is distributed in the hope that it will be useful,               *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU             *
16 * Lesser General Public License for more details.                               *
17 *                                                                               *
18 * You should have received a copy of the GNU Lesser General Public              *
19 * License along with this library; if not, write to the Free Software           *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.    *
21 *********************************************************************************
22 * $Id: FXUTF32Codec.cpp,v 1.4 2005/01/16 16:06:07 fox Exp $                     *
23 ********************************************************************************/
24 #include "xincs.h"
25 #include "fxver.h"
26 #include "fxdefs.h"
27 #include "FXTextCodec.h"
28 #include "FXUTF32Codec.h"
29 
30 
31 /*
32   Notes:
33   - Some code and alogorithms lifted from Roman Czyborra's page on
34     Unicode Transformation Formats (http://czyborra.com/utf).
35   - What about UTF-32BE (big-endian) and UTF-32LE (little-endian)?
36 */
37 
38 /*******************************************************************************/
39 
40 namespace FX {
41 
42 
43 /// Convert to UTF-32; return the number of bytes written to dest
fromUnicode(FXuchar * & dest,unsigned long m,const FXwchar * & src,unsigned long n)44 unsigned long FXUTF32Codec::fromUnicode(FXuchar*& dest,unsigned long m,const FXwchar*& src,unsigned long n){
45   FXASSERT(src);
46   FXASSERT(dest);
47   return 0;
48   }
49 
50 
51 /// Convert a sequence of bytes from UTF-32; return the number of bytes read from src
toUnicode(FXwchar * & dest,unsigned long m,const FXuchar * & src,unsigned long n)52 unsigned long FXUTF32Codec::toUnicode(FXwchar*& dest,unsigned long m,const FXuchar*& src,unsigned long n){
53   FXASSERT(src);
54   FXASSERT(dest);
55   return 0;
56   }
57 
58 
59 // Return the IANA mime name for this codec
mimeName() const60 const FXchar* FXUTF32Codec::mimeName() const {
61   return "UTF-32";
62   }
63 
64 
65 // Return code for UTF-32
mibEnum() const66 FXint FXUTF32Codec::mibEnum() const {
67   return 1017;
68   }
69 
70 
71 }
72 
73