You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-9
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,10 @@
1
1
# StringEncodings
2
2
3
-
[](https://travis-ci.org/nalimilan/StringEncodings.jl)
3
+
[](https://travis-ci.org/JuliaStrings/StringEncodings.jl)
This Julia package provides support for decoding and encoding texts between multiple character encodings. It is currently based on the iconv interface, and supports all major platforms using either the native iconv support or [GNU libiconv](https://www.gnu.org/software/libiconv/). In the future, native Julia support for major encodings will be added.
@@ -82,12 +81,12 @@ julia> write(f, "café\nnoël")
82
81
julia>close(f); # Essential to complete encoding
83
82
```
84
83
85
-
The contents of the file can then be read back using `readstring`:
84
+
The contents of the file can then be read back using `read(path, String)`:
86
85
```julia
87
-
julia>readstring(path) # Standard function expects UTF-8
86
+
julia>read(path, String) # Standard function expects UTF-8
88
87
"\U3d83f7c0f\0澊\0n\0o\0迬\0"
89
88
90
-
julia>readstring(path, enc"UTF-16") # Works when passing the correct encoding
89
+
julia>read(path, String, enc"UTF-16") # Works when passing the correct encoding
91
90
"café\nnoël"
92
91
```
93
92
@@ -115,7 +114,7 @@ When performing more complex operations on an encoded text file, it will often b
115
114
```julia
116
115
julia> io =open(path, enc"UTF-16");
117
116
118
-
julia>readstring(io)
117
+
julia>read(io, String)
119
118
"café\nnoël"
120
119
```
121
120
@@ -142,7 +141,7 @@ julia> seek(b, 0); # Move to start of buffer
142
141
143
142
julia> s =StringDecoder(b, "UTF-16");
144
143
145
-
julia>readstring(s) # Decoding happens automatically here
144
+
julia>read(s, String) # Decoding happens automatically here
0 commit comments