Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

编码不是用的utf-8吗 #9

Open
luckyhua opened this issue Apr 6, 2017 · 13 comments
Open

编码不是用的utf-8吗 #9

luckyhua opened this issue Apr 6, 2017 · 13 comments

Comments

@luckyhua
Copy link

luckyhua commented Apr 6, 2017

为什么我用idea导入之后全是乱码,jsp正常,我项目编码都设置的utf-8

@peng-xin
Copy link

peng-xin commented Apr 6, 2017

jsp内容乱码?

@luckyhua
Copy link
Author

luckyhua commented Apr 6, 2017

jsp正常,java代码中文乱码

@luckyhua
Copy link
Author

luckyhua commented Apr 6, 2017

`
/**

*/
@controller
@RequestMapping("/admin/blog")
public class BlogAdminController {

@Resource
private BlogService blogService;
@Resource
private CommentService commentService;

private BlogIndex blogIndex = new BlogIndex();

//��Ӻ͸��²���
@RequestMapping("/save")
public String save(Blog blog, HttpServletResponse response) throws Exception {
	
	int resultTotal = 0; //���շ��ؽ����¼��
	if(blog.getId() == null) { //˵���ǵ�һ�β���
		resultTotal = blogService.addBlog(blog);
		blogIndex.addIndex(blog); //��Ӳ��͵�����
	} else { //��id��ʾ�޸�
		resultTotal = blogService.update(blog);
		blogIndex.updateIndex(blog);
	}

`

@peng-xin
Copy link

peng-xin commented Apr 6, 2017

我感觉你换下gbk应该就不乱码了

@luckyhua
Copy link
Author

luckyhua commented Apr 6, 2017

换了一样

@luckyhua
Copy link
Author

luckyhua commented Apr 6, 2017

全问号了

@peng-xin
Copy link

peng-xin commented Apr 6, 2017

他java文件的编码方式是GBK的

@peng-xin
Copy link

peng-xin commented Apr 6, 2017

写的时候可能就不统一,你现在要改的话估计也麻烦

@luckyhua
Copy link
Author

luckyhua commented Apr 6, 2017

是的,我刚把项目的编码改过GB2312,就全问号了,sql语句中文也是,我就自己到这里copy了一份

@peng-xin
Copy link

peng-xin commented Apr 6, 2017

是GBK,不是GB2312,你换成GBK就都正常了

@luckyhua
Copy link
Author

luckyhua commented Apr 6, 2017

GBK可以

@luckyhua
Copy link
Author

luckyhua commented Apr 6, 2017

有点麻烦

@sunmingshuai
Copy link

是啊 怎么还有这种问题... 竟然不是utf-8.... 瞬间不想看了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants