Dave's Brain

Browse - Programming Tips - How can I decode UTF-8 characters with perl?

Date: 2017oct16
Language: perl

Q.  How can I decode UTF-8 characters with perl?

A.  Use the `Encode` package.

use utf8; use Encode; my($in) = 'some utf-8 letters'; my(@a) = split(//, decode('utf-8', $in));
@a will hold the letters of the string.

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.