Skip to content

Commit b62fa5c

Browse files
authored
Make character encoding support optional
1 parent a50fd6a commit b62fa5c

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

src/common/character_set.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717
use crate::Exceptions;
1818
use crate::common::Result;
1919

20-
#[cfg(all(not(feature = "encoding_rs"), not(feature = "legacy_encoding")))]
21-
compile_error!(
22-
"Either feature 'encoding_rs' or 'legacy_encoding' must be enabled for CharacterSet support."
23-
);
24-
2520
/**
2621
* Encapsulates a Character Set ECI, according to "Extended Channel Interpretations" 5.3.1.1
2722
* of ISO 18004.
@@ -144,6 +139,21 @@ impl CharacterSet {
144139
}
145140
}
146141

142+
#[cfg(all(not(feature = "encoding_rs"), not(feature = "legacy_encoding")))]
143+
impl CharacterSet {
144+
pub fn encode(&self, _input: &str) -> Result<Vec<u8>> {
145+
unimplemented!()
146+
}
147+
148+
pub fn encode_replace(&self, _input: &str) -> Result<Vec<u8>> {
149+
unimplemented!()
150+
}
151+
152+
pub fn decode(&self, _input: &[u8]) -> Result<String> {
153+
unimplemented!()
154+
}
155+
}
156+
147157
// MODERN IMPLEMENTATION (encoding_rs)
148158
#[cfg(feature = "encoding_rs")]
149159
impl CharacterSet {

0 commit comments

Comments
 (0)