]>
git.ipfire.org Git - thirdparty/squid.git/blob - lib/charset.c
2 * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
4 * Squid software is distributed under GPLv2+ license and includes
5 * contributions from numerous individuals and organizations.
6 * Please see the COPYING and CONTRIBUTORS files for details.
12 /** Convert ISO-LATIN-1 to UTF-8 */
14 latin1_to_utf8(char *out
, size_t size
, const char *in
)
16 unsigned char *p
= (unsigned char *)out
;
17 for (; *in
&& size
> 2; in
++) {
18 unsigned char ch
= (unsigned char)*in
;
23 *p
++ = (ch
>> 6) | 0xc0;
25 *p
++ = (ch
& 0x3f) | 0x80;