如下java代码导出的csv文件用Excel打开还是乱码, 用Sublime Text的Save with Encoding -> UTF-8 with BOM
public static void exportWithOpencsvBySql(String sql, String file) throws Exception {
OutputStreamWriter ows = new OutputStreamWriter(new FileOutputStream(new File("/tmp/" + file)), "utf-8");
try {
CSVWriter writer = new CSVWriter(ows);