diff options
Diffstat (limited to 'src/main/java/at/gv/egiz/pdfas/impl')
-rw-r--r-- | src/main/java/at/gv/egiz/pdfas/impl/input/TextDataSourceImpl.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/at/gv/egiz/pdfas/impl/input/TextDataSourceImpl.java b/src/main/java/at/gv/egiz/pdfas/impl/input/TextDataSourceImpl.java index c983a8a..077ed97 100644 --- a/src/main/java/at/gv/egiz/pdfas/impl/input/TextDataSourceImpl.java +++ b/src/main/java/at/gv/egiz/pdfas/impl/input/TextDataSourceImpl.java @@ -26,6 +26,8 @@ public class TextDataSourceImpl implements TextDataSource * The text.
*/
protected String text = null;
+
+ private final static String CHARSET = "UTF-8";
/**
* Constructor that sets the text.
@@ -53,7 +55,7 @@ public class TextDataSourceImpl implements TextDataSource {
try
{
- byte[] data = getText().getBytes("UTF-8");
+ byte[] data = getText().getBytes(CHARSET);
// PERF: if memory is an issue (e.g. in web), use a FileBased TextDataSource instead.
return new ByteArrayInputStream(data);
}
@@ -70,7 +72,7 @@ public class TextDataSourceImpl implements TextDataSource {
try
{
- byte[] data = getText().getBytes("UTF-8");
+ byte[] data = getText().getBytes(CHARSET);
return data.length;
}
catch (UnsupportedEncodingException e)
@@ -86,7 +88,7 @@ public class TextDataSourceImpl implements TextDataSource {
try
{
- byte[] data = getText().getBytes("UTF-8");
+ byte[] data = getText().getBytes(CHARSET);
return data;
}
catch (UnsupportedEncodingException e)
|