---
title: "opencart 商品说明乱码"
author: "ynial"
date: "2012-09-08T10:50:53Z"
tags: []
categories: ["编程语言"]
slug: "opencart"
draft: false
lastmod: "2012-09-08T10:50:00Z"
id: 1673931
url: "https://ynial.iteye.com/blog/1673931"
---

opencart 一个不错的电商开源框架，一个小问题opencart 商品说明乱码
简单看了一下源码，
在opencart\catalog\controller\product\category.php 中
找到

```java
 'description' => $this->msubstr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 100) ...', '
```



修改一下就OK了
windows 下 开发 确保PHP.INI 的 extension=php_mbstring.dll  是可用的

```java

'description' => mb_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 100, 'utf-8') . '..',
					

```