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 32 #ifndef __MTP__UNICODE__H 33 #define __MTP__UNICODE__H 34 35 int ucs2_strlen(uint16_t const * const); 36 char *utf16_to_utf8(LIBMTP_mtpdevice_t*,const uint16_t*); 37 uint16_t *utf8_to_utf16(LIBMTP_mtpdevice_t*, const char*); 38 void strip_7bit_from_utf8(char *str); 39 40 #endif /* __MTP__UNICODE__H */ 41