在哪里修复字符编码问题:在db插入之前 [英] Where to fix character encoding issues: before db insertion

查看:112
本文介绍了在哪里修复字符编码问题:在db插入之前的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用mssql后端工作web项目,而不是在我的控制,除了点击它。
很多数据用乱码字符替换了商标,引号,注册符号和引号。

I'm working web project with a mssql backend, not in my control except for tapping it. A lot of the data is littered with garbage characters in place of tradmarks, quotes, register symbols and quotes.

我在渲染的html to utf-8。

The html I'm rendering in is set to utf-8.

这个编码问题是否应该考虑将数据插入到db?

Is this encoding problem something that should be taken care of on the insertion of the data into the db?

推荐答案

问题应该在哪儿出错。

The problem should be taken care of where it's wrong. If you try to take care of it somewhere else, then you don't fix the problem, you only try to recover lost data.

如果您尝试在其他地方处理它,那么您不能解决这个问题,您只能尝试恢复丢失的数据。必须正确做到一切。如果您在过程中的某一点对其进行编码或解码不正确,则无法在任何其他点可靠地解决它。

When you handle encoded text, you have to do it correctly all the way. If you encode it or decode it incorrectly at one point in the process, you can't reliably fix it at any other point.

您必须找出文本通过检查数据发生了什么,并应用该修复程序错误地编码或解码。

You have to find out where the text gets encoded or decoded incorrectly by examining what's happening to the data, and apply the fix there.

这篇关于在哪里修复字符编码问题:在db插入之前的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆