chromium/third_party/pdfium/core/fxcrt/fx_codepage.h

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

// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

#ifndef CORE_FXCRT_FX_CODEPAGE_H_
#define CORE_FXCRT_FX_CODEPAGE_H_

#include <stdint.h>

#include <array>

// Prove consistency with incomplete forward definitions.
#include "core/fxcrt/fx_codepage_forward.h"
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/span.h"

enum class FX_CodePage : uint16_t {};

enum class FX_Charset : uint8_t {};

// Hi-bytes to unicode codepoint mapping for various code pages.
struct FX_CharsetUnicodes {};

extern const std::array<FX_CharsetUnicodes, 8> kFX_CharsetUnicodes;

FX_CodePage FX_GetACP();
FX_CodePage FX_GetCodePageFromCharset(FX_Charset charset);
FX_Charset FX_GetCharsetFromCodePage(FX_CodePage codepage);
FX_Charset FX_GetCharsetFromInt(int value);
bool FX_CharSetIsCJK(FX_Charset uCharset);
size_t FX_WideCharToMultiByte(FX_CodePage codepage,
                              WideStringView wstr,
                              pdfium::span<char> buf);
size_t FX_MultiByteToWideChar(FX_CodePage codepage,
                              ByteStringView bstr,
                              pdfium::span<wchar_t> buf);

#endif  // CORE_FXCRT_FX_CODEPAGE_H_