Converted character set to ISO8859.
[cake.git] / workbench / libs / codesetslib / developer / examples / test.c
blob4bbf0104aebe6a954645f943f6de820475b5e2f7
1 /***************************************************************************
3 codesets.library - Amiga shared library for handling different codesets
4 Copyright (C) 2001-2005 by Alfonso [alfie] Ranieri <alforan@tin.it>.
5 Copyright (C) 2005-2007 by codesets.library Open Source Team
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
17 codesets.library project: http://sourceforge.net/projects/codesetslib/
19 Most of the code included in this file was relicensed from GPL to LGPL
20 from the source code of SimpleMail (http://www.sf.net/projects/simplemail)
21 with full permissions by its authors.
23 $Id$
25 ***************************************************************************/
27 #include <proto/exec.h>
28 #include <proto/codesets.h>
29 #include <stdio.h>
30 #include <string.h>
33 int main(int argc,char **argv)
35 int res = 0;
36 if((CodesetsBase = OpenLibrary(CODESETSNAME,CODESETSVER)))
38 #if 0
39 char *str;
41 if(argc>1)
42 str = argv[1];
43 else
44 str = STR;
46 // check that the string only contains UTF8
47 // sequences.
48 if(CodesetsIsValidUTF8(str))
50 CodesetsUTF8ToStr(CSA_Source, str,
51 CSA_DestLen, 32,
52 CSA_DestHook, &destHook,
53 TAG_DONE);
55 else
56 printf("Error: example string wasn't recognized as UTF8!\n");
58 res = 0;
59 #endif
60 CloseLibrary(CodesetsBase);
61 CodesetsBase = NULL;
63 else
65 printf("can't open %s %d+\n",CODESETSNAME,CODESETSVER);
66 res = 20;
68 return res;