---
title: "perl 匹配中文和中文转码问题"
author: "jackyyang8"
date: "2012-10-11T13:29:45Z"
tags: []
categories: ["编程语言"]
slug: "perl"
draft: false
lastmod: "2012-10-11T13:29:45Z"
id: 1696371
url: "https://jackyyang8.iteye.com/blog/1696371"
---

记录一下，搞了好几天，呵呵
$str =~ s/([\x80-\xFF][\x80-\xFF])/sprintf("&#x%X;", ord decode("GBK", $1))/ego;