1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Author: alekseys@google.com (Aleksey Shlyapnikov)
7 // This code is not actually used, it was copied here for the reference only.
8 // See cld_htmlutils_windows.cc for Windows version of this code.
10 #include "cld/encodings/compact_lang_det/win/cld_htmlutils.h"
12 #include "cld/third_party/utf/utf.h" // for runetochar
13 #include "cld/webutil/html/htmlutils.h" // for ReadEntity
15 // Copied from getonescriptspan.cc
18 // Writes entity value to dst. Returns take(src), put(dst) byte counts
19 void EntityToBuffer(const char* src
, int len
, char* dst
,
20 int* tlen
, int* plen
) {
21 char32 entval
= HtmlUtils::ReadEntity(src
, len
, tlen
);
22 // ReadEntity does this already: entval = FixUnicodeValue(entval);
25 *plen
= runetochar(dst
, &entval
);
27 // Illegal entity; ignore the '&'
31 // fprintf(stderr,"t%d p%d]\n", *tlen, *plen);