Skip to content
This repository was archived by the owner on Nov 21, 2018. It is now read-only.

Commit 8922cc2

Browse files
Fix build errors in rust-encoding by updating to 40717f5
1 parent 762c204 commit 8922cc2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+24311
-25971
lines changed

rust-encoding-0.3.0/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
target
2+
Cargo.lock
3+
src/index/.cache

rust-encoding-0.3.0/.travis.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
language: rust
2+
rust: nightly
3+
os:
4+
- linux
5+
- osx
6+
script:
7+
- cargo build -v
8+
- make test
9+
- cargo doc

rust-encoding-0.3.0/AUTHORS.txt

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Encoding is mainly written by Kang Seonghoon <[email protected]>,
2+
and also the following people (in ascending order):
3+
4+
Aaron Weiss <[email protected]>
5+
Alex Crichton <[email protected]>
6+
Andrew Cann <[email protected]>
7+
Aneesh Agrawal <[email protected]>
8+
Björn Steinbrink <[email protected]>
9+
Brian Koropoff <[email protected]>
10+
Clark Gaebel <[email protected]>
11+
12+
Filipe Gonçalves <[email protected]>
13+
Florian Gilcher <[email protected]>
14+
Frank Denis <[email protected]>
15+
Jack Moffitt <[email protected]>
16+
Jason Ozias <[email protected]>
17+
Jason Ozias <[email protected]>
18+
Joonas Javanainen <[email protected]>
19+
Joshua DeSeno <[email protected]>
20+
Keegan McAllister <[email protected]>
21+
Ken Tossell <[email protected]>
22+
Kyle Dewey <[email protected]>
23+
Manish Goregaokar <[email protected]>
24+
Matt Brubeck <[email protected]>
25+
Michael Neumann <[email protected]>
26+
Michael Sproul <[email protected]>
27+
Peter Atashian <[email protected]>
28+
Pierre Baillet <[email protected]>
29+
Robert Straw <[email protected]>
30+
Simon Sapin <[email protected]>
31+
Simonas Kazlauskas <[email protected]>
32+
33+
Steve Klabnik <[email protected]>
34+
35+
Сухарик <[email protected]>

rust-encoding-0.3.0/Cargo.lock

+63
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust-encoding.0.2.32/Cargo.toml renamed to rust-encoding-0.3.0/Cargo.toml

+19-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "encoding"
3-
version = "0.2.32"
3+
version = "0.3.0-dev"
44
authors = ["Kang Seonghoon <[email protected]>"]
55

66
description = "Character encoding support for Rust"
@@ -14,6 +14,19 @@ license = "MIT"
1414
[lib]
1515
name = "encoding"
1616

17+
[features]
18+
no-optimized-legacy-encoding = [
19+
"encoding-index-singlebyte/no-optimized-legacy-encoding",
20+
"encoding-index-korean/no-optimized-legacy-encoding",
21+
"encoding-index-japanese/no-optimized-legacy-encoding",
22+
"encoding-index-simpchinese/no-optimized-legacy-encoding",
23+
"encoding-index-tradchinese/no-optimized-legacy-encoding",
24+
]
25+
26+
[dependencies.encoding-types]
27+
version = "0.2"
28+
path = "src/types"
29+
1730
# version policy for index tables:
1831
# - major: addition or deletion of index tables
1932
# - minor: any content changes to index tables, numbered by the date
@@ -23,25 +36,24 @@ name = "encoding"
2336
# so we should use tilde requirements here.
2437

2538
[dependencies.encoding-index-singlebyte]
26-
version = "~1.20141219.5"
39+
version = "~1.20160120.0"
2740
path = "src/index/singlebyte"
2841

2942
[dependencies.encoding-index-korean]
30-
version = "~1.20141219.5"
43+
version = "~1.20141219.6"
3144
path = "src/index/korean"
3245

3346
[dependencies.encoding-index-japanese]
34-
version = "~1.20141219.5"
47+
version = "~1.20141219.6"
3548
path = "src/index/japanese"
3649

3750
[dependencies.encoding-index-simpchinese]
38-
version = "~1.20141219.5"
51+
version = "~1.20160120.0"
3952
path = "src/index/simpchinese"
4053

4154
[dependencies.encoding-index-tradchinese]
42-
version = "~1.20141219.5"
55+
version = "~1.20141219.6"
4356
path = "src/index/tradchinese"
4457

4558
[dev-dependencies]
4659
getopts = "*" # for examples
47-
File renamed without changes.

rust-encoding-0.3.0/Makefile

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.PHONY: all
2+
all:
3+
@echo 'Try `cargo build` instead.'
4+
5+
.PHONY: authors
6+
authors:
7+
echo 'Encoding is mainly written by Kang Seonghoon <[email protected]>,' > AUTHORS.txt
8+
echo 'and also the following people (in ascending order):' >> AUTHORS.txt
9+
echo >> AUTHORS.txt
10+
git log --format='%aN <%aE>' | grep -v 'Kang Seonghoon' | sort -u >> AUTHORS.txt
11+
12+
.PHONY: test
13+
test:
14+
# `test_correct_table` tests with indices with non-BMP mappings tend to be
15+
# very slow without the optimization, so japanese and tradchinese got flags
16+
cargo test -v
17+
cargo test -v -p encoding-index-singlebyte
18+
cargo test -v -p encoding-index-korean
19+
RUSTFLAGS='-C opt-level=1' cargo test -v -p encoding-index-japanese
20+
cargo test -v -p encoding-index-simpchinese
21+
RUSTFLAGS='-C opt-level=1' cargo test -v -p encoding-index-tradchinese
22+
cargo test -v -p encoding-types
23+
24+
.PHONY: readme
25+
readme: README.md
26+
27+
README.md: src/lib.rs
28+
# really, really sorry for this mess.
29+
awk '/^\/\/! # Encoding /{print "[Encoding][doc]",$$4}' $< > $@
30+
awk '/^\/\/! # Encoding /{print "[Encoding][doc]",$$4}' $< | sed 's/./=/g' >> $@
31+
echo >> $@
32+
echo '[![Encoding on Travis CI][travis-image]][travis]' >> $@
33+
echo >> $@
34+
echo '[travis-image]: https://travis-ci.org/lifthrasiir/rust-encoding.png' >> $@
35+
echo '[travis]: https://travis-ci.org/lifthrasiir/rust-encoding' >> $@
36+
awk '/^\/\/! # Encoding /,/^\/\/! ## /' $< | cut -b 5- | grep -v '^#' >> $@
37+
echo '[Complete Documentation][doc] (stable)' >> $@
38+
echo >> $@
39+
echo '[doc]: https://lifthrasiir.github.io/rust-encoding/' >> $@
40+
echo >> $@
41+
awk '/^\/\/! ## /,!/^\/\/!/' $< | cut -b 5- >> $@

rust-encoding.0.2.32/src/lib.rs renamed to rust-encoding-0.3.0/README.md

+31-77
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
1-
// This is a part of rust-encoding.
2-
// Copyright (c) 2013-2015, Kang Seonghoon.
3-
// See README.md and LICENSE.txt for details.
1+
[Encoding][doc] 0.3.0-dev
2+
=========================
43

5-
/*!
4+
[![Encoding on Travis CI][travis-image]][travis]
65

7-
# Encoding 0.2.32
6+
[travis-image]: https://travis-ci.org/lifthrasiir/rust-encoding.png
7+
[travis]: https://travis-ci.org/lifthrasiir/rust-encoding
88

99
Character encoding support for Rust. (also known as `rust-encoding`)
1010
It is based on [WHATWG Encoding Standard](http://encoding.spec.whatwg.org/),
1111
and also provides an advanced interface for error detection and recovery.
1212

13-
## Usage
13+
*This documentation is for the development version (0.3).
14+
Please see the [stable documentation][doc] for 0.2.x versions.*
1415

15-
Put this in your `Cargo.toml`:
16+
[Complete Documentation][doc] (stable)
1617

17-
```toml
18-
[dependencies]
19-
encoding = "0.2"
20-
```
18+
[doc]: https://lifthrasiir.github.io/rust-encoding/
19+
20+
## Usage
2121

22-
Or in the case you are using Rust 1.0 beta, pin the exact version:
22+
Put this in your `Cargo.toml`:
2323

2424
```toml
2525
[dependencies]
26-
encoding = "=0.2.32"
26+
encoding = "0.3"
2727
```
2828

2929
Then put this in your crate root:
@@ -32,6 +32,22 @@ Then put this in your crate root:
3232
extern crate encoding;
3333
```
3434

35+
### Data Table
36+
37+
By default, Encoding comes with ~480 KB of data table ("indices").
38+
This allows Encoding to encode and decode legacy encodings efficiently,
39+
but this might not be desirable for some applications.
40+
41+
Encoding provides the `no-optimized-legacy-encoding` Cargo feature
42+
to reduce the size of encoding tables (to ~185 KB)
43+
at the expense of encoding performance (typically 5x to 20x slower).
44+
The decoding performance remains identical.
45+
**This feature is strongly intended for end users.
46+
Do not try to enable this feature from library crates, ever.**
47+
48+
For finer-tuned optimization, see `src/index/gen_index.py` for
49+
custom table generation.
50+
3551
## Overview
3652

3753
To encode a string:
@@ -156,7 +172,8 @@ There are two ways to get `Encoding`:
156172
You should use them when the encoding would not change or only handful of them are required.
157173
Combined with link-time optimization, any unused encoding would be discarded from the binary.
158174
* `encoding::label` has functions to dynamically get an encoding from given string ("label").
159-
They will return a static reference to the encoding, which type is also known as `EncodingRef`.
175+
They will return a static reference to the encoding,
176+
which type is also known as `EncodingRef`.
160177
It is useful when a list of required encodings is not available in advance,
161178
but it will result in the larger binary and missed optimization opportunities.
162179

@@ -211,66 +228,3 @@ The only standards reliable in this regard are WHATWG Encoding Standard and
211228
[vendor-provided mappings from the Unicode consortium](http://www.unicode.org/Public/MAPPINGS/).
212229
Whenever in doubt, look at the source code and specifications for detailed explanations.
213230

214-
*/
215-
216-
#![cfg_attr(test, feature(test))] // lib stability features as per RFC #507
217-
218-
extern crate encoding_index_singlebyte as index_singlebyte;
219-
extern crate encoding_index_korean as index_korean;
220-
extern crate encoding_index_japanese as index_japanese;
221-
extern crate encoding_index_simpchinese as index_simpchinese;
222-
extern crate encoding_index_tradchinese as index_tradchinese;
223-
224-
#[cfg(test)] extern crate test;
225-
226-
pub use self::types::{CodecError, ByteWriter, StringWriter,
227-
RawEncoder, RawDecoder, EncodingRef, Encoding,
228-
EncoderTrapFunc, DecoderTrapFunc, DecoderTrap,
229-
EncoderTrap, decode}; // reexport
230-
231-
#[macro_use] mod util;
232-
#[cfg(test)] #[macro_use] mod testutils;
233-
234-
pub mod types;
235-
236-
/// Codec implementations.
237-
pub mod codec {
238-
pub mod error;
239-
pub mod ascii;
240-
pub mod singlebyte;
241-
pub mod utf_8;
242-
pub mod utf_16;
243-
pub mod korean;
244-
pub mod japanese;
245-
pub mod simpchinese;
246-
pub mod tradchinese;
247-
pub mod whatwg;
248-
}
249-
250-
pub mod all;
251-
pub mod label;
252-
253-
#[cfg(test)]
254-
mod tests {
255-
use super::*;
256-
257-
#[test]
258-
fn test_decode() {
259-
fn test_one(input: &[u8], expected_result: &str, expected_encoding: &str) {
260-
let (result, used_encoding) = decode(
261-
input, DecoderTrap::Strict, all::ISO_8859_1 as EncodingRef);
262-
let result = result.unwrap();
263-
assert_eq!(used_encoding.name(), expected_encoding);
264-
assert_eq!(&result[..], expected_result);
265-
}
266-
267-
test_one(&[0xEF, 0xBB, 0xBF, 0xC3, 0xA9], "é", "utf-8");
268-
test_one(&[0xC3, 0xA9], "é", "iso-8859-1");
269-
270-
test_one(&[0xFE, 0xFF, 0x00, 0xE9], "é", "utf-16be");
271-
test_one(&[0x00, 0xE9], "\x00é", "iso-8859-1");
272-
273-
test_one(&[0xFF, 0xFE, 0xE9, 0x00], "é", "utf-16le");
274-
test_one(&[0xE9, 0x00], \x00", "iso-8859-1");
275-
}
276-
}

0 commit comments

Comments
 (0)