Linus Walleij | 7b7a0e2 | 2007-02-05 18:22:27 +0000 | [diff] [blame] | 1 | /** |
| 2 | * \file unicode.h |
| 3 | * |
| 4 | * This file contains general Unicode string manipulation functions. |
| 5 | * It mainly consist of functions for converting between UCS-2 (used on |
| 6 | * the devices) and UTF-8 (used by several applications). |
| 7 | * |
| 8 | * For a deeper understanding of Unicode encoding formats see the |
| 9 | * Wikipedia entries for |
| 10 | * <a href="http://en.wikipedia.org/wiki/UTF-16/UCS-2">UTF-16/UCS-2</a> |
| 11 | * and <a href="http://en.wikipedia.org/wiki/UTF-8">UTF-8</a>. |
| 12 | * |
| 13 | * Copyright (C) 2005-2007 Linus Walleij <triad@df.lth.se> |
| 14 | * |
| 15 | * This library is free software; you can redistribute it and/or |
| 16 | * modify it under the terms of the GNU Lesser General Public |
| 17 | * License as published by the Free Software Foundation; either |
| 18 | * version 2 of the License, or (at your option) any later version. |
| 19 | * |
| 20 | * This library is distributed in the hope that it will be useful, |
| 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 23 | * Lesser General Public License for more details. |
| 24 | * |
| 25 | * You should have received a copy of the GNU Lesser General Public |
| 26 | * License along with this library; if not, write to the |
| 27 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 28 | * Boston, MA 02111-1307, USA. |
| 29 | * |
| 30 | */ |
| 31 | |
Linus Walleij | b9256fd | 2006-02-15 09:40:43 +0000 | [diff] [blame] | 32 | #ifndef __MTP__UNICODE__H |
| 33 | #define __MTP__UNICODE__H |
| 34 | |
Linus Walleij | 438bd7f | 2006-06-08 11:35:44 +0000 | [diff] [blame] | 35 | int ucs2_strlen(uint16_t const * const); |
Linus Walleij | 3ec8631 | 2006-08-21 13:25:24 +0000 | [diff] [blame] | 36 | char *utf16_to_utf8(LIBMTP_mtpdevice_t*,const uint16_t*); |
Linus Walleij | f3c4405 | 2008-08-16 21:14:56 +0000 | [diff] [blame] | 37 | uint16_t *utf8_to_utf16(LIBMTP_mtpdevice_t*, const char*); |
Linus Walleij | d3b7857 | 2007-08-24 21:28:24 +0000 | [diff] [blame] | 38 | void strip_7bit_from_utf8(char *str); |
Linus Walleij | b9256fd | 2006-02-15 09:40:43 +0000 | [diff] [blame] | 39 | |
| 40 | #endif /* __MTP__UNICODE__H */ |