Skip to content

Commit 0130f89

Browse files
authored
Merge pull request #3 from ECP-Solutions/utf8_encoding_support
UTF-8 encoding support
2 parents 4993d7f + b46a0c0 commit 0130f89

24 files changed

+403
-949
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ECPTextStream is an easy-to-use class module developed to enable buffered text s
88
## Advantages
99
* The fastest way for I/O operations over "big" text files from VBA (up to 600 MB/sec.).
1010
![Benchmark](/docs/home/TextRead-Benchmark.png)
11+
* [UTF-8](https://www.unicode.org/faq/utf_bom.html#UTF8) encoding support. Do you have a text file, perhaps in chinese or some other foreign cyrillic language, downloaded from the Internet? This library is made to help you deal with it! You will be able to read and write UTF-8 encoded files in an easy way.
1112
* Supports files up to 2 GB of size.
1213
* Supports streams delimited by CRLF, LF and CR characters. This is useful when working with structured files like CSVs.
1314
* No memory overloads. Text files being read using a buffer, small enough to hold a single data line.
@@ -33,7 +34,7 @@ Visit [this site](https://ws-garcia.github.io/ECPTextStream/limitations/index.ht
3334

3435
## License
3536

36-
Copyright (C) 2021-2023 [W. García](https://github.com/ws-garcia/).
37+
Copyright (C) 2025 [ECP Solutions](https://github.com/ecp-solutions/).
3738

3839
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
3940

docs/api/methods/detectencoding.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: DetectEncoding
3+
parent: Methods
4+
grand_parent: API
5+
nav_order: 2
6+
---
7+
8+
# DetectEncoding
9+
{: .fs-9 }
10+
11+
Use heuristics to try to infer the encoding of the target text file.
12+
{: .fs-6 .fw-300 }
13+
14+
---
15+
16+
## Syntax
17+
18+
*expression*.`DetectEncoding`*(FilePath)*
19+
20+
### Parameters
21+
22+
The required *FilePath* argument is an identifier specifying a `String` type variable.
23+
24+
### Return value
25+
26+
*Type*: `String`
27+
28+
>📝**Note**
29+
>{: .text-grey-lt-000 .bg-green-000 }
30+
>The `DetectEncoding` method supports files with or without BOM. the following encodings can be detected: `ANSI`, `UTF-8` and `UTF-16`(BE,LE).
31+
{: .text-grey-dk-300 .bg-grey-lt-000 }
32+
33+
See also
34+
: [ReadText Method](https://ecp-solutions.github.io/ECPTextStream/api/methods/readtext.html).
35+
36+
---
37+
38+
[Back to Methods overview](https://ecp-solutions.github.io/VBA-CSV-interface/api/methods/)

docs/api/methods/openstream.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: OpenStream
33
parent: Methods
44
grand_parent: API
5-
nav_order: 2
5+
nav_order: 3
66
---
77

88
# OpenStream

docs/api/methods/readtext.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: ReadText
33
parent: Methods
44
grand_parent: API
5-
nav_order: 3
5+
nav_order: 4
66
---
77

88
# ReadText

docs/api/methods/restartstreamreader.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: RestartStreamReader
33
parent: Methods
44
grand_parent: API
5-
nav_order: 4
5+
nav_order: 5
66
---
77

88
# RestartStreamReader

docs/api/methods/seekpointer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: SeekPointer
33
parent: Methods
44
grand_parent: API
5-
nav_order: 5
5+
nav_order: 6
66
---
77

88
# SeekPointer

docs/api/methods/writeblanklines.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: WriteBlankLines
33
parent: Methods
44
grand_parent: API
5-
nav_order: 6
5+
nav_order: 7
66
---
77

88
# WriteBlankLines

docs/api/methods/writetext.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: WriteText
33
parent: Methods
44
grand_parent: API
5-
nav_order: 7
5+
nav_order: 8
66
---
77

88
# WriteText
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: autoDetectEncoding
3+
parent: Properties
4+
grand_parent: API
5+
nav_order: 2
6+
---
7+
8+
# autoDetectEncoding
9+
{: .fs-9 }
10+
11+
Defines whether the tool should attempt to automatically infer the file encoding.
12+
{: .fs-6 .fw-300 }
13+
14+
---
15+
16+
## ReadWrite
17+
18+
_Yes_
19+
20+
---
21+
22+
## Syntax
23+
24+
|**_Accesor_**|**_Syntax_**|
25+
|:----------|:----------|
26+
|Get|*expression*.`autoDetectEncoding`|
27+
|Let|*expression*.`autoDetectEncoding` = value|
28+
29+
|**_Accesor_**|**_Parameters_**|
30+
|:----------|:----------|
31+
|Get|_None_|
32+
|Let|*Name*: Value<br>*Type*: `Boolean`<br>*Modifiers*: `ByVal`|
33+
34+
|**_Accesor_**|**_Returns Type_**|
35+
|:----------|:----------|
36+
|Get|`Boolean`|
37+
|Let|_None_|
38+
39+
>📝**Note**
40+
>{: .text-grey-lt-000 .bg-green-000 }
41+
>At the moment the tool can detect the following encodings: `ANSI`, `UTF-8` and `UTF-16`(BE,LE).
42+
{: .text-grey-dk-300 .bg-grey-lt-000 }
43+
44+
See also
45+
: [ReadText Method](https://ecp-solutions.github.io/ECPTextStream/api/methods/readtext.html).
46+
47+
---
48+
49+
[Back to Properties overview](https://ecp-solutions.github.io/ECPTextStream/api/properties/)

docs/api/properties/bufferlength.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: bufferLength
33
parent: Properties
44
grand_parent: API
5-
nav_order: 2
5+
nav_order: 3
66
---
77

88
# bufferLength

0 commit comments

Comments
 (0)