Linked Questions

4 votes
1 answer
175 views

Issue matching accented characters with Perl

This code: perl -pe 's/^(\D\w+ \w+)( word )/\1;word/gi' doesn't work when the input has words with accented or particular characters like: á, Ș. Precisations: I have this code to make a count of ...
manub's user avatar
  • 53
2 votes
1 answer
438 views

Perl-generated UTF8 strings in JSON corrupted on client side

I have a Perl CGI script that is accessing Thai language, UTF-8 strings from a PostgreSQL DB and returning them to a web-based front end as JSON. The strings are fine when I get them from the DB and ...
Sally Goldin's user avatar
2 votes
2 answers
250 views

Perl - Correcting char encoding on command line input

I am writing a program to fix mangled encoding, specifically latin1(iso-8859-1) to greek (iso-8859-7). I created a function that works as intended; a variable with badly encoded text is converted ...
MERM's user avatar
  • 733
3 votes
1 answer
486 views

How to send email via Email::Simple?

I want to send email. My Email::Simple (module version 2.216) object is: Email::Simple { body => \## EXCEPTION MESSAGE RU Error message: Какой-то текст‚ at /home/kes/work/projects/tucha/...
Eugen Konkov's user avatar
  • 23.6k
2 votes
2 answers
273 views

encoding question in perl

I have an encoding question and would like to ask for help. I notice if I choose "UTF-8" as encoding, there are (at least) two double quotes " and “. But when I choose "ISO-8859-1" as the encoding, I ...
Qiang Li's user avatar
  • 10.8k
2 votes
2 answers
160 views

Perl character encoding confusion

I have a multiline $string variable that contains UTF-8 csv. I open this string as a file for processing and print its contents. open(my $fh, "<", \$string); $/=undef; say <$fh>; ...
Philippe A.'s user avatar
  • 2,935
3 votes
1 answer
203 views

How does Perl multiple-line regex matching interact with Unicode character properties?

I am processing a multiple-line string, with Unix (\n) line breaks. Some of its lines have the form "A, a" (i.e. upper-case letter, comma, space, lower-case letter), and I want to delete those from ...
Jonathan Pool's user avatar
1 vote
1 answer
378 views

PHP: Problems finding the most frequent character in a UTF-8 string (eg 唐犬土用家犬尨犬山桑)?

From an MySQL database I can extract the following utf-8 characters: "唐犬土用家犬尨犬山桑山犬巴戦師子幻日幻月引綱忠犬愛犬戌年成犬教条教義" I am trying to find the most frequent character in this string. I tried putting each as ...
ajo's user avatar
  • 1,075
2 votes
3 answers
128 views

Perl: How can I inject the UTF-8 pragma in a boilerplate module?

I have a Perl boilerplate module similar to common::sense or Modern::Perl. It's roughly a rip off of Modern::Perl. It looks like this (shortened to keep this question concise): package Prologue; use ...
Patrick Böker's user avatar
0 votes
2 answers
76 views

Why dosn't "use utf-8;" work when used inside a Perl module?

We had a bug in a library, that was caused by one of the inputs being Unicode. It was fixed by adding use utf8; to the script using that library. However, adding use utf8; to the library itself (so ...
DVK's user avatar
  • 128k
2 votes
1 answer
162 views

How to detect the :utf8 open pragma (or any conversions for the file-handles)?

In my previous question I asked about the problem with encoding and open pragma. Based on @daxim's answer coming to my mind another questions. use open qw(:std :utf8); It is a good practice using ...
clt60's user avatar
  • 62.8k
0 votes
2 answers
156 views

Javascript function using regex

I have created a function using reg-ex to validate a field in JavaScript. My function is //FIRST NAME VALIDATION var strFilter = /^[A-Za-z]*$/; var fname = document.getElementById('fname'); fname = ...
Rahul Singh's user avatar
  • 1,636
1 vote
4 answers
94 views

Regex validation quick fix most likely

I am try to validate a form to make the user enter their full name like the following.. First, Last The user must have some string of alphabetic only chars, then a comma, then a space, then a ...
Pistol Pete's user avatar
0 votes
2 answers
82 views

How to remove leading whitespace denoted with ? using rename in MacOS

I have directories that looks like this in my MacOs: For example ???9-24_v_hMrgprx2 where ??? is actually white spaces. What I want to do is to use rename to remove those leading white spaces. I ...
littleworth's user avatar
  • 5,049
0 votes
1 answer
76 views

Reading file breaks encoding in Perl

I have script for reading html files in Perl, it works, but it breaks encoding. This is my script: use utf8; use Data::Dumper; open my $fr, '<', 'file.html' or die "Can't open file $!"; my $...
tomsk's user avatar
  • 987

15 30 50 per page