1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /* Evolution Conduits - Pilot Map routines |
---|
3 | * |
---|
4 | * Copyright (C) 2000 Ximian, Inc. |
---|
5 | * |
---|
6 | * Authors: JP Rosevear <jpr@ximian.com> |
---|
7 | * |
---|
8 | * This program is free software; you can redistribute it and/or |
---|
9 | * modify it under the terms of version 2 of the GNU General Public |
---|
10 | * License as published by the Free Software Foundation. |
---|
11 | * |
---|
12 | * This program 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 | * General Public License for more details. |
---|
16 | * |
---|
17 | * You should have received a copy of the GNU General Public |
---|
18 | * License along with this program; if not, write to the |
---|
19 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
20 | * Boston, MA 02111-1307, USA. |
---|
21 | */ |
---|
22 | |
---|
23 | #include <stdlib.h> |
---|
24 | #include <time.h> |
---|
25 | #include <gnome-xml/parser.h> |
---|
26 | #include <pi-util.h> |
---|
27 | |
---|
28 | #include "e-pilot-util.h" |
---|
29 | |
---|
30 | char * |
---|
31 | e_pilot_utf8_to_pchar (const char *string) |
---|
32 | { |
---|
33 | char *pstring = NULL; |
---|
34 | int res; |
---|
35 | |
---|
36 | if (!string) |
---|
37 | return NULL; |
---|
38 | |
---|
39 | res = convert_ToPilotChar ("UTF-8", string, strlen (string), &pstring); |
---|
40 | |
---|
41 | if (res != 0) |
---|
42 | pstring = strdup (string); |
---|
43 | |
---|
44 | return pstring; |
---|
45 | } |
---|
46 | |
---|
47 | char * |
---|
48 | e_pilot_utf8_from_pchar (const char *string) |
---|
49 | { |
---|
50 | char *ustring = NULL; |
---|
51 | int res; |
---|
52 | |
---|
53 | if (!string) |
---|
54 | return NULL; |
---|
55 | |
---|
56 | res = convert_FromPilotChar ("UTF-8", string, strlen (string), &ustring); |
---|
57 | |
---|
58 | if (res != 0) |
---|
59 | ustring = strdup (string); |
---|
60 | |
---|
61 | return ustring; |
---|
62 | } |
---|