Changeset ffe7b714 in git


Ignore:
Timestamp:
15/05/11 04:44:45 (8 years ago)
Author:
Olly Betts <olly@…>
Branches:
add-show-splays, line_contents, master, stereo, svn/github/master, svn/origin/master, svn/tags/1.1.16, svn/tags/1.2.0, svn/tags/1.2.1, svn/tags/1.2.2, svn/tags/1.2.3, svn/tags/1.2.4, svn/tags/1.2.5, svn/trunk, travis-osx
Children:
ecdb631
Parents:
f3f9b0e
Message:

lib/fixmsgs.pl: Update to fix UTF-8 rather than ISO8859-1.

git-svn-id: file:///home/survex-svn/survex/trunk@3581 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rf3f9b0e rffe7b714  
     1Sun May 15 03:44:17 GMT 2011  Olly Betts <olly@survex.com>
     2
     3        * lib/fixmsgs.pl: Update to fix UTF-8 rather than ISO8859-1.
     4
    15Sun May 15 03:43:46 GMT 2011  Olly Betts <olly@survex.com>
    26
  • lib/fixmsgs.pl

    rf3f9b0e rffe7b714  
    11#!/usr/bin/perl -w
    22require 5.008;
    3 use bytes;
     3use open ':encoding(utf8)';
    44use strict;
    55
     
    77
    88my @ent = ();
    9 for (128..255) {
     9for (128..65536) {
    1010   $ent[$_] = "#$_";
    1111}
     
    2626   my ($pre, $msg) = /^([-\w,]+:\s*\d+\s+)(.*)/;
    2727
    28    $msg =~ s/([\x80-\xff])/"&".$ent[ord($1)].";"/ge;
     28   $msg =~ s/([\x{80}-\x{ffff}])/"&".$ent[ord($1)].";"/ge;
    2929
    3030   $msg =~ s/'\%s'/`%s'/g;
Note: See TracChangeset for help on using the changeset viewer.