Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tlug: Perl Problem with 2-byte char [Off Topic?]




Hi all,

I am having a problem with a double-byte character in a perl script I am
writing. I asked this question on ActiveStates Perl mailing list, but got no
helpful response. Not many double-byte users on there, it seems.

I was hoping that with this being a linux list in Japan that there might be some
people on here with enough knowledge/experience in working with Perl in a
double-byte environment to offer some help/advice.

My environment is Japanese perl (jperl) on FreeBSD.

My script basically takes an input string and searches a text file for matches.
The text file contains both single- and double-tye characters. The script
searches the text file for lines containing the input string, then returns the
whole line (not just the input string only).
This works fine with both single- and double-byte characters except for the
character "ー" (the long vowel hypen as in サービス).
If this char is not input, but occurs in the line in the text file, the results
are output as intended.
However, if the char is input by the user, I get an error referring to an
incorrect character.
I think this is because the double-byte code for this char is interpreted as
containing a "]," which confuses the script.


Does anyone have any ideas as to how to get the script to accept input of this
char?

Thanks in advice for any help, and sorry if this was off topic.

Shawn Gray
Translator / Perl Scripter Wanna-be
Canon, Inc.


-------------------------------------------------------------------
Next Nomikai: September 17 (Fri), 19:30 Tengu TokyoEkiMae 03-3275-3691
Next Technical Meeting: October 9 (Sat), 13:00     place: Temple Univ.
-------------------------------------------------------------------
more info: http://www.tlug.gr.jp        Sponsor: Global Online Japan

Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links