aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java')
-rw-r--r--src/java/com/healthmarketscience/jackcess/Column.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/java/com/healthmarketscience/jackcess/Column.java b/src/java/com/healthmarketscience/jackcess/Column.java
index 666fa1e..1eba865 100644
--- a/src/java/com/healthmarketscience/jackcess/Column.java
+++ b/src/java/com/healthmarketscience/jackcess/Column.java
@@ -1386,13 +1386,15 @@ public class Column implements Comparable<Column> {
/**
* @param text Text to encode
- * @param db relevant db
+ * @param charset database charset
* @return A buffer with the text encoded
*/
public static ByteBuffer encodeUncompressedText(CharSequence text,
Charset charset)
{
- return charset.encode(CharBuffer.wrap(text));
+ CharBuffer cb = ((text instanceof CharBuffer) ?
+ (CharBuffer)text : CharBuffer.wrap(text));
+ return charset.encode(cb);
}