Sha256: 4f31967b3638bfeb5fa86a3348f665e9c430627e7f5f0d5795a7f65dd6f663fa

Contents?: true

Size: 1.13 KB

Versions: 32

Compression:

Stored size: 1.13 KB

Contents

// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "encodings/compact_lang_det/win/cld_unilib.h"

#include "encodings/compact_lang_det/win/cld_basictypes.h"

namespace cld_UniLib {

// Table of UTF-8 character lengths, based on first byte
static const unsigned char kUTF8LenTbl[256] = {
  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,
  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,
  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,
  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,

  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,
  1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,
  2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,
  3,3,3,3,3,3,3,3, 3,3,3,3,3,3,3,3, 4,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4
};

// Return length of a single UTF-8 source character
int OneCharLen(const char* src) {
  return kUTF8LenTbl[*reinterpret_cast<const uint8*>(src)];
}

}  // namespace cld_UniLib

Version data entries

32 entries across 18 versions & 4 rubygems

Version Path
cld-0.13.0 ext/cld/encodings/compact_lang_det/win/cld_unilib_windows.cc
cld-0.13.0 ext/cld/encodings/compact_lang_det/win/#cld_unilib_windows.cc#
language_detection-0.1.1 ext/cld/encodings/compact_lang_det/win/cld_unilib_windows.cc
cld-0.12.0 ext/cld/encodings/compact_lang_det/win/#cld_unilib_windows.cc#
cld-0.12.0 ext/cld/encodings/compact_lang_det/win/cld_unilib_windows.cc
language_detection-0.1.0 ext/cld/encodings/compact_lang_det/win/cld_unilib_windows.cc
cld-0.11.0 ext/cld/encodings/compact_lang_det/win/#cld_unilib_windows.cc#
cld-0.11.0 ext/cld/encodings/compact_lang_det/win/cld_unilib_windows.cc
cld-0.10.0 ext/cld/encodings/compact_lang_det/win/cld_unilib_windows.cc
cld-0.10.0 ext/cld/encodings/compact_lang_det/win/#cld_unilib_windows.cc#
cld-0.8.0 ext/cld/encodings/compact_lang_det/win/#cld_unilib_windows.cc#
cld-0.8.0 ext/cld/encodings/compact_lang_det/win/cld_unilib_windows.cc
cld-fixed-0.7.1 ext/cld/encodings/compact_lang_det/win/#cld_unilib_windows.cc#
cld-fixed-0.7.1 ext/cld/encodings/compact_lang_det/win/cld_unilib_windows.cc
cld-0.7.0 ext/cld/encodings/compact_lang_det/win/#cld_unilib_windows.cc#
cld-0.7.0 ext/cld/encodings/compact_lang_det/win/cld_unilib_windows.cc
language_detection-0.0.2 ext/cld/encodings/compact_lang_det/win/cld_unilib_windows.cc
language_detection-0.0.1 ext/cld/encodings/compact_lang_det/win/cld_unilib_windows.cc
cld-0.6.0 ext/cld/encodings/compact_lang_det/win/#cld_unilib_windows.cc#
cld-0.6.0 ext/cld/encodings/compact_lang_det/win/cld_unilib_windows.cc