Skip to content

Commit 7728a6d

Browse files
committed
Fix readme for #15
1 parent 50fe503 commit 7728a6d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,19 @@ argument can be a `Buffer` or a `String`. Strings are converted to buffers
4040
using `utf-8` encoding.
4141

4242
If `mediatype` is not specified, then `application/octet-stream` is used
43-
as a default.
43+
as a default if the data is a Buffer, and `text/plain;charset=UTF-8` if
44+
the data is a String.
4445

4546
```js
4647
var dataUri = require('strong-data-uri');
4748

4849
uri = dataUri.encode('foo');
4950
console.log(uri);
50-
// data:application/octet-stream;base64,Zm9v
51+
// data:text/plain;charset=UTF-8;base64,Zm9v
5152

52-
uri = dataUri.encode(new Buffer('foo', 'utf8'), 'text/plain');
53+
uri = dataUri.encode(new Buffer('<foo/>', 'utf8'), 'text/xml');
5354
console.log(uri);
54-
// data:text/plain;base64,Zm9v
55+
// data:text/xml;base64,PGZvby8+
5556
```
5657

5758
## Command-line access

0 commit comments

Comments
 (0)