utf8 strings in Perl


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting utf8 strings in Perl
# 1  
Old 07-14-2009
utf8 strings in Perl

Hi All


I need help on how to handle utf8 strings (match, split etc.) in Perl. Thanks in advance.
# 2  
Old 07-14-2009
Perl uses UTF8 internally anyways. If you want to read/write UTF8 files, use :utf8 from the PerlIO layer when opening the file. If you want to tell Perl that the sources are UTF8 coded, put a 'use utf8;' somewhere at the beginning.
# 3  
Old 07-14-2009
Thankx a lot.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl script to delimit size of strings

Hello, I have a huge file of over 2,00,00,00 strings in UTF8 format. I have managed to write a script in Perl which sorts them neatly as per their Unicode ranges. However I am now stuck with a script which will pipe out all strings between 3 and 20 letters/characters. I am not very good at... (2 Replies)
Discussion started by: gimley
2 Replies

2. Programming

Perl:how to find multiple strings

Hi , i'm trying to find lines in a file that have 2 matches,but i have trouble with regex -it doesn't search for a second string-please help #!/usr/bin/perl -w use strict; use warnings; my $log = "log"; my $log_string = "grep '^8=' $log |"; usage (); chomp (my $TAB_1 = $ARGV); chomp (my... (2 Replies)
Discussion started by: auto_w
2 Replies

3. Shell Programming and Scripting

Replacing strings in perl script

HI all, These are examples of the original value from a variable $abc can be FastEthernet1/0 GigabitEthernet3/1 Serial1/0 If $abc is FastEthernet*/* (where * can be any number), replace $abc value to fa*/* (same number as the original value). GigabitEthernet becomes ga*/* and Serial... (2 Replies)
Discussion started by: tententen
2 Replies

4. Shell Programming and Scripting

Perl removing strings from a variable value

Dear all, I have a variable called $abc, which the value is something like below, *** *********** : ***** where * can be anything. I need to remove all but the final characters until last whitespace. example grd groupstudy : tutor6/7 becomes tutor6/7 something like if... (2 Replies)
Discussion started by: tententen
2 Replies

5. Shell Programming and Scripting

UTF8 encoding

Hi experts, I have a gz file from other system(solaris), which is ftped to our system(solaris). After gunzip, the file is a xml file and we are using ORACLE built in xml transformiing tool ORAXSL to transform XML to TXT. Now the issue is we come accross issue regarding UTF8 as below:... (1 Reply)
Discussion started by: summer_cherry
1 Replies

6. Shell Programming and Scripting

How extract strings (perl)

Sample data: revision001 | some text | some text Comment: some comment Brief: 1) brief 2) brief ------------------------------------------ revision002 | some text | some text Brief: 1) brief 2) brief FIX: some fix ------------------------------------------ revision003 | some... (8 Replies)
Discussion started by: inotech
8 Replies

7. Shell Programming and Scripting

Help with perl scripting on strings

Hai, I have strings as follows. 0 INDEX MODE: ANALYZED (UNIQUE SCAN) OF 'SYS_C0030166' (INDEX (UNIQUE)) 1 INDEX MODE: ANALYZED (UNIQUE SCAN) OF 'SYS_C0029845' (INDEX (UNIQUE) 9 INDEX MODE: ANALYZED (RANGE SCAN) OF ... (2 Replies)
Discussion started by: sagarbsa
2 Replies

8. Shell Programming and Scripting

Perl RegExp to remove last character from strings

I use SAS (a statistical software) and have to remove last character or the last 1/2 numbers that appear after characters from the string using Perl Regular Expression (which is recognized by SAS). Input: f183ii10 f183ii2 f182ii1 f182ii2 f183iim f22ii f22ii11 f22ii12 pmh4 pmhm Desired... (2 Replies)
Discussion started by: ospreyeagle
2 Replies

9. UNIX for Advanced & Expert Users

Utf8-utf16

Hi All, When we create a flat file using a PLSQL program , the flat file is being created in UTF8 format.This file has lot of german characters.When we use this file to load data into MS SQL Server, the german characters are coming as junk. When we create a flat file in oracle it is being ... (1 Reply)
Discussion started by: Suppandi
1 Replies

10. Shell Programming and Scripting

sort() array of strings in perl

I have a perl script with an array of clients. @arr = ("The ABC Corp", "AA Corp.", "BB Corp"); If I run @a = sort (@arr); I will get @a = ("AA Corp", "BB Corp", "The ABC Corp"); but I want @a = ("AA Corp, "The ABC Corp", "BB Corp"); How do I sort array without changing... (2 Replies)
Discussion started by: photon
2 Replies
Login or Register to Ask a Question