最近开发一个vue的小项目的时候,就碰到了这个问题,但其实HTML中已经设置了Utf-8编码方式,css中的中文仍然有概率会出现乱码
- css:
- 如上图,预期效果应该是显示中文 ‘开’:
解决办法
可以是直接把中文转为一串utf8编码,然后替换进去,下面我们来聊聊要怎么做。
- 在百度直接搜索 ‘在线中文转UTF8’,随便找一个网站:
- 这里就以 https://www.ip138.com/utf8/ 为例:
- 输入我们的中文字符串,然后点击转换,就可以得到一串UTF8编码:开
- 接下来把 开 前面的 &#x 和 末尾的分号 ; 去掉, 就只剩下 5F00,然后在前面加一个反斜杠 \ ,最终就得到了 \5F00
- 然后把它替换掉CSS中的中文字符串即可:
- 然后刷新一下网页,最好先清理一下浏览器的缓存,不然可能页面没有反应(浏览器缓存清理方法)
其他
- 有些网站转出来的可能不是 开 这个格式可能会是 %u5F00 ,还可能是 \u5F00 ;处理方式都是差不多的,把前面的 %u 或是 \u 删掉,并在前面添加反斜杠 \ 。
- 显然前缀都只是标记,为了去告诉计算机这是一个转义需要的UTF8编码,而不要输出为一串数字和字母,但在CSS中应使用反斜杠转义。
Greetings! Very useful advice in this particular post! It is the little changes that produce the greatest changes. Many thanks for sharing!
Wonderful article! We are linking to this particularly great article on our website. Keep up the good writing.
There’s certainly a lot to find out about this subject. I really like all the points you made.
Very good info. Lucky me I recently found your site by chance (stumbleupon). I’ve book-marked it for later!
There is certainly a great deal to find out about this subject. I really like all of the points you’ve made.
Way cool! Some very valid points! I appreciate you writing this write-up plus the rest of the website is also very good.
I was able to find good information from your blog articles.
Oh my goodness! Incredible article dude! Thanks, However I am encountering issues with your RSS. I don’t know why I can’t join it. Is there anybody else having the same RSS issues? Anyone who knows the solution will you kindly respond? Thanx!
I’m amazed, I have to admit. Seldom do I encounter a blog that’s both equally educative and interesting, and without a doubt, you have hit the nail on the head. The issue is something too few folks are speaking intelligently about. I’m very happy that I found this in my hunt for something concerning this.
Greetings! Very helpful advice within this post! It’s the little changes which will make the biggest changes. Thanks for sharing!
I used to be able to find good advice from your articles.
May I just say what a relief to find someone who actually understands what they’re discussing on the internet. You definitely know how to bring a problem to light and make it important. A lot more people have to look at this and understand this side of your story. I was surprised you are not more popular because you most certainly possess the gift.
Everything is very open with a clear clarification of the challenges. It was truly informative. Your website is extremely helpful. Thanks for sharing.
Oh my goodness! Awesome article dude! Thank you, However I am going through troubles with your RSS. I don’t understand why I am unable to join it. Is there anybody else getting similar RSS problems? Anyone who knows the solution will you kindly respond? Thanks!!
Greetings! Very useful advice within this article! It is the little changes that make the largest changes. Thanks a lot for sharing!
I like this web blog it’s a master piece! Glad I observed this on google.
Euro travel guide
Aw, this was a really nice post. Spending some time and actual effort to create a really good article… but what can I say… I hesitate a whole lot and never seem to get anything done.
Good write-up. I absolutely appreciate this site. Thanks!
I have to thank you for the efforts you’ve put in writing this website. I’m hoping to view the same high-grade content from you in the future as well. In truth, your creative writing abilities has motivated me to get my very own website now 😉
Way cool! Some very valid points! I appreciate you penning this post and the rest of the site is also very good.
That is a very good tip particularly to those new to the blogosphere. Short but very accurate info… Thank you for sharing this one. A must read post.
This is a good tip especially to those fresh to the blogosphere. Brief but very accurate info… Thank you for sharing this one. A must read post!
I quite like reading through an article that will make men and women think. Also, many thanks for allowing me to comment.
That is a great tip especially to those new to the blogosphere. Short but very accurate info… Many thanks for sharing this one. A must read article.
I blog frequently and I truly appreciate your information. The article has really peaked my interest. I’m going to bookmark your blog and keep checking for new details about once per week. I subscribed to your RSS feed too.
I’m extremely pleased to uncover this web site. I want to to thank you for your time for this particularly wonderful read!! I definitely loved every part of it and I have you saved as a favorite to look at new stuff in your site.
Millions of people bought them, because they represented a miracle.
Can I simply just say what a relief to uncover someone who actually understands what they are talking about on the web. You definitely realize how to bring a problem to light and make it important. A lot more people really need to check this out and understand this side of the story. I was surprised you are not more popular since you most certainly possess the gift.
This is a very good tip particularly to those new to the blogosphere. Short but very precise information… Thank you for sharing this one. A must read article!
I love it when people get together and share thoughts. Great website, continue the good work!
This is a good tip particularly to those new to the blogosphere. Short but very accurate info… Many thanks for sharing this one. A must read article.
Even though investors are nervous to start investing more again you can make it easier on yourself by thinking about your own personal risk tolerance.
Perhaps the most important information you’ll need to claim Social Security is your age.
Often, returns during the catch-up phase are split with the manager receiving the larger (e.g.
Investors have alternatives, you can park you wealth in cash an pray that the unrelenting money printing finally ends.
An impressive share! I’ve just forwarded this onto a co-worker who was conducting a little research on this. And he in fact ordered me dinner simply because I discovered it for him… lol. So allow me to reword this…. Thank YOU for the meal!! But yeah, thanx for spending the time to talk about this topic here on your blog.
Howdy! I could have sworn I’ve visited your blog before but after going through many of the posts I realized it’s new to me. Regardless, I’m certainly happy I stumbled upon it and I’ll be bookmarking it and checking back frequently!
I used to be able to find good advice from your content.
Greetings! Very helpful advice in this particular post! It is the little changes that make the most important changes. Thanks a lot for sharing!
One of the additional doctrines that a value investor needs to follow especially when it comes to identifying margin of safety and the intrinsic value of a stock is to make a perception that the stock market has brought down the value of the stock irrationally.
1003 would cost $28 million over the 2014-2018 period, assuming appropriation of the necessary amounts.
Right here is the perfect webpage for everyone who hopes to find out about this topic. You understand a whole lot its almost hard to argue with you (not that I really would want to…HaHa). You certainly put a brand new spin on a topic that’s been written about for years. Excellent stuff, just great.
With an online brokerage account you can easily buy and sell currencies with the click of a mouse.
Based on the Global Stock Market Review by Standard and Poor’s, Australia’s stock exchange is the 9th largest worldwide in total market capitalisation terms and the 2nd largest in the Asia-Pacific region, after Japan’s.
After I originally left a comment I appear to have clicked on the -Notify me when new comments are added- checkbox and from now on each time a comment is added I recieve 4 emails with the same comment. Perhaps there is a way you can remove me from that service? Many thanks.
As opposed to investing, intraday trading involves buying and selling shares on the same day of the stock market.
You are so interesting! I don’t think I’ve truly read a single thing like that before. So wonderful to find somebody with a few unique thoughts on this subject matter. Seriously.. many thanks for starting this up. This web site is one thing that is needed on the web, someone with a little originality.
Your style is very unique in comparison to other people I have read stuff from. Thanks for posting when you’ve got the opportunity, Guess I will just bookmark this site.
Can I simply just say what a comfort to discover an individual who actually knows what they’re discussing online. You certainly realize how to bring an issue to light and make it important. More and more people have to look at this and understand this side of your story. I was surprised that you aren’t more popular since you surely have the gift.
Saved as a favorite, I really like your blog.