cscg24-guacamole

CSCG 2024 Challenge 'Guacamole Mashup'
git clone https://git.sinitax.com/sinitax/cscg24-guacamole
Log | Files | Refs | sfeed.txt

unicode.h (1806B)


      1/*
      2 * Licensed to the Apache Software Foundation (ASF) under one
      3 * or more contributor license agreements.  See the NOTICE file
      4 * distributed with this work for additional information
      5 * regarding copyright ownership.  The ASF licenses this file
      6 * to you under the Apache License, Version 2.0 (the
      7 * "License"); you may not use this file except in compliance
      8 * with the License.  You may obtain a copy of the License at
      9 *
     10 *   http://www.apache.org/licenses/LICENSE-2.0
     11 *
     12 * Unless required by applicable law or agreed to in writing,
     13 * software distributed under the License is distributed on an
     14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
     15 * KIND, either express or implied.  See the License for the
     16 * specific language governing permissions and limitations
     17 * under the License.
     18 */
     19
     20#ifndef GUAC_RDP_UNICODE_H
     21#define GUAC_RDP_UNICODE_H
     22
     23/**
     24 * Convert the given number of UTF-16 characters to UTF-8 characters.
     25 *
     26 * @param utf16
     27 *     Arbitrary UTF-16 data.
     28 *
     29 * @param length
     30 *     The length of the UTF-16 data, in characters.
     31 *
     32 * @param utf8
     33 *     Buffer to which the converted UTF-8 data will be written.
     34 *
     35 * @param size
     36 *     The maximum number of bytes available in the UTF-8 buffer.
     37 */
     38void guac_rdp_utf16_to_utf8(const unsigned char* utf16, int length,
     39        char* utf8, int size);
     40
     41/**
     42 * Convert the given number of UTF-8 characters to UTF-16 characters.
     43 *
     44 * @param utf8
     45 *     Arbitrary UTF-8 data.
     46 *
     47 * @param length
     48 *     The length of the UTF-8 data, in characters.
     49 *
     50 * @param utf16
     51 *     Buffer to which the converted UTF-16 data will be written.
     52 *
     53 * @param size
     54 *     The maximum number of bytes available in the UTF-16 buffer.
     55 */
     56void guac_rdp_utf8_to_utf16(const unsigned char* utf8, int length,
     57        char* utf16, int size);
     58
     59#endif
     60