chromium/url/url_canon_icu.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/350788890): Remove this and spanify to fix the errors.
#pragma allow_unsafe_buffers
#endif

// ICU-based character set converter.

#include "url/url_canon_icu.h"

#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include "base/check.h"
#include "base/memory/stack_allocated.h"
#include "third_party/icu/source/common/unicode/ucnv.h"
#include "third_party/icu/source/common/unicode/ucnv_cb.h"
#include "third_party/icu/source/common/unicode/utypes.h"
#include "url/url_canon_internal.h"  // for _itoa_s

namespace url {

namespace {

// Called when converting a character that can not be represented, this will
// append an escaped version of the numerical character reference for that code
// point. It is of the form "&#1234;" and we will escape the non-digits to
// "%26%231234%3B". Why? This is what Netscape did back in the olden days.
void appendURLEscapedChar(const void* context,
                          UConverterFromUnicodeArgs* from_args,
                          const UChar* code_units,
                          int32_t length,
                          UChar32 code_point,
                          UConverterCallbackReason reason,
                          UErrorCode* err) {}

// A class for scoping the installation of the invalid character callback.
class AppendHandlerInstaller {};

}  // namespace

ICUCharsetConverter::ICUCharsetConverter(UConverter* converter)
    :{}

ICUCharsetConverter::~ICUCharsetConverter() = default;

void ICUCharsetConverter::ConvertFromUTF16(const char16_t* input,
                                           int input_len,
                                           CanonOutput* output) {}

}  // namespace url