|
|
@@ -12,6 +12,7 @@ import java.awt.*;
|
|
|
import java.awt.image.BufferedImage;
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
import java.io.IOException;
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
import java.net.URL;
|
|
|
import java.util.Date;
|
|
|
|
|
|
@@ -101,7 +102,11 @@ public class Watermark {
|
|
|
tempLineLen += tempCharLen;
|
|
|
if (tempLineLen >= imgWidth) {
|
|
|
// 长度已经满一行,进行文字叠加
|
|
|
- graphics.drawString(sb.toString(), tempX, tempY);
|
|
|
+ try {
|
|
|
+ graphics.drawString(new String(sb.toString().getBytes("UTF-8"), "ISO-8859-1"), tempX, tempY);
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
// 清空内容,重新追加
|
|
|
sb.delete(0, sb.length());
|
|
|
tempLineLen = 0;
|