https://github.com/clavoie/charset
Clojure wrappers around java.nio.charset.Charset
https://github.com/clavoie/charset
Last synced: 2 months ago
JSON representation
Clojure wrappers around java.nio.charset.Charset
- Host: GitHub
- URL: https://github.com/clavoie/charset
- Owner: clavoie
- License: epl-1.0
- Created: 2013-10-12T16:08:54.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-03T15:51:05.000Z (over 10 years ago)
- Last Synced: 2025-04-12T00:49:41.635Z (2 months ago)
- Language: Clojure
- Size: 306 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
charset
=======Clojure wrappers around some of the class and instance methods of java.nio.charset.Charset.
## Installation
Add the following dependency to your `project.clj` file:
[](http://clojars.org/charset)
## Usage
```clojure
user=> (require ['charset.core :refer ['ascii 'utf-8 'utf-16]]
['charset.bytes :refer ['get-bytes 'ascii-bytes
'utf8-bytes 'utf16-bytes]])
niluser=> (def street "Maple St")
#'user/streetuser=> (get-bytes street)
#user=> (get-bytes street "ascii")
#user=> (get-bytes street ascii)
#user=> (ascii-bytes street)
#user=> (String. (ascii-bytes street))
"Maple St"user=> (String. (utf8-bytes street))
"Maple St"user=> (String. (utf16-bytes street) "utf-16")
"Maple St"
```## Documentation
[API](http://clavoie.github.io/charset/)
## License
Copyright © 2013-2014 Chris LaVoie
Distributed under the Eclipse Public License, the same as Clojure.