#include "config.h"
Go to the source code of this file.
Functions | |
int | ucs2_strlen (uint16_t const *const) |
char * | utf16_to_utf8 (LIBMTP_mtpdevice_t *, const uint16_t *) |
For a deeper understanding of Unicode encoding formats see the Wikipedia entries for UTF-16/UCS-2 and UTF-8.
Copyright (C) 2005-2007 Linus Walleij <triad@df.lth.se>
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
int ucs2_strlen | ( | uint16_t const *const | unicstr | ) |
Gets the length (in characters, not bytes) of a unicode UCS-2 string, eg a string which physically is 0x00 0x41 0x00 0x00 will return a value of 1.
unicstr | a UCS-2 Unicode string |
char* utf16_to_utf8 | ( | LIBMTP_mtpdevice_t * | device, | |
const uint16_t * | unicstr | |||
) |
Converts a big-endian UTF-16 2-byte string to a UTF-8 string. Actually just a UCS-2 internal conversion routine that strips off the BOM if there is one.
device | a pointer to the current device. | |
unicstr | the UTF-16 unicode string to convert |