Sha256: b0de226d33c56514434f3689c25bef5ccf2a2a2dfa203b066aa538bd8ad5f450

Contents?: true

Size: 1.08 KB

Versions: 18

Compression:

Stored size: 1.08 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.

// Author: alekseys@google.com (Aleksey Shlyapnikov)

// This code is not actually used, it was copied here for the reference only.
// See cld_htmlutils_windows.cc for Windows version of this code.

#include "cld/encodings/compact_lang_det/win/cld_htmlutils.h"

#include "cld/third_party/utf/utf.h"        // for runetochar
#include "cld/webutil/html/htmlutils.h"     // for ReadEntity

// Copied from getonescriptspan.cc

// Src points to '&'
// Writes entity value to dst. Returns take(src), put(dst) byte counts
void EntityToBuffer(const char* src, int len, char* dst,
                    int* tlen, int* plen) {
  char32 entval = HtmlUtils::ReadEntity(src, len, tlen);
  // ReadEntity does this already: entval = FixUnicodeValue(entval);

  if (entval > 0) {
    *plen = runetochar(dst, &entval);
  } else {
    // Illegal entity; ignore the '&'
    *tlen = 1;
    *plen = 0;
  }
  // fprintf(stderr,"t%d p%d]\n", *tlen, *plen);
}

Version data entries

18 entries across 18 versions & 4 rubygems

Version Path
cld-0.13.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_google3.cc
language_detection-0.1.1 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_google3.cc
cld-0.12.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_google3.cc
language_detection-0.1.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_google3.cc
cld-0.11.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_google3.cc
cld-0.10.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_google3.cc
cld-0.8.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_google3.cc
cld-fixed-0.7.1 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_google3.cc
cld-0.7.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_google3.cc
language_detection-0.0.2 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_google3.cc
language_detection-0.0.1 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_google3.cc
cld-0.6.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_google3.cc
cld-0.5.0 ext/cld/encodings/compact_lang_det/win/cld_htmlutils_google3.cc
krukid-cld-0.4.0 encodings/compact_lang_det/win/cld_htmlutils_google3.cc
cld-0.4.0 encodings/compact_lang_det/win/cld_htmlutils_google3.cc
cld-0.3.0 encodings/compact_lang_det/win/cld_htmlutils_google3.cc
cld-0.2.0 encodings/compact_lang_det/win/cld_htmlutils_google3.cc
cld-0.1.0 encodings/compact_lang_det/win/cld_htmlutils_google3.cc