PDA

View Full Version : Help me! SOS



cuongdh
20-08-2004, 01:45
Trong Oracle Form.
Tôi cần mở 1 file dạng *.txt nhưng lưu dạng UTF8 hoặc Unicode thi phải làm thế nào?

andes
20-08-2004, 08:07
Không hiểu í bạn là sao?
Mở file txt bằng Oracle forms hay là viết chương trình mở file txt trong oracle forms??

cuongdh
21-08-2004, 23:32
Tôi muốn đọc từ CSDL Oracle ra file dạng txt các trường Varchar2, number .
Trong CSDL la UTF8.
Nhưng lưu ra file *.txt chỉ được dạng ANSI.
Làm thế nào để lưu được dưới dạng UTF8

nganminh
28-08-2004, 03:47
// encode co the nhan cac gia tri:
// UTF8, windows-1252,...
try {
FileOutputStream fos = new FileOutputStream(toFile);

OutputStreamWriter osw = new OutputStreamWriter(fos, encode);
PrintWriter pw = new PrintWriter(osw);
pw.println(sContent);
pw.close();
System.out.println("Filename: " + toFile);
}
catch (IOException ioe) {
System.err.println(ioe);
}

Thử đoạn code trên xem sao nhé.
Lưu ý là đoạn code trên viết bằng Java đấy!!!

Chúc vui