Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / Perl / January 2007



Tip: Looking for answers? Try searching our database.

Encode-JIS2K-0.02 problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nobumi Iyanaga - 03 Jan 2007 14:52 GMT
Hello,

I downloaded and installed Encode-JIS2K-0.02.  Install log says that  
all tests were successful.  But when I do this:

#!/usr/bin/perl

use strict;
use warnings;

use Encode::JIS2K;
use Encode qw/encode decode/;

my $infile = "some_shiftjisx0123.txt";

undef $/;

open (IN, $infile);

$_ = <IN>;

close (IN);

binmode (STDOUT, ":utf8");

$_ = decode ("shiftjisx0123", $_);

print;

I get this error message:
untitled text 4:21:  Unknown encoding 'shiftjisx0123'

What am I doing wrong...??

-------

And -- if I can solve this problem, I would like to find out from  
text files in shiftjisx0123 characters which belong only to JIS X  
0213, not to JIS X 0212.  Is this possible...??

Thank you very much in advance.

Best regards,

Nobumi Iyanaga
Tokyo,
Japan
Joel Rees - 04 Jan 2007 07:09 GMT
> Hello,
>
[quoted text clipped - 27 lines]
> I get this error message:
> untitled text 4:21:  Unknown encoding 'shiftjisx0123'

Is that a typo?

> What am I doing wrong...??

Maybe 0123 should be 2013?

(I've never seen the version number for jis tagged on the end, but ...)

> -------
>
> And -- if I can solve this problem, I would like to find out from  
> text files in shiftjisx0123 characters which belong only to JIS X  
> 0213, not to JIS X 0212.  Is this possible...??

I'm sure it's possible, either by making something like an isprint  
boolean table for each entire character set, or be slurping the file  
and scanning it in parallel from memory. I think it should even be  
possible to open two read-only streams on the same file, read  
characters out, and throw some message when the one doesn't match the  
other.

Don't know if there are any shortcut tools for it.

> Thank you very much in advance.
>
[quoted text clipped - 3 lines]
> Tokyo,
> Japan
Nobumi Iyanaga - 04 Jan 2007 08:34 GMT
Hello Joel,

>> $_ = decode ("shiftjisx0123", $_);
>>
[quoted text clipped - 11 lines]
> (I've never seen the version number for jis tagged on the end,  
> but ...)

Ah! thank you!  That's right.  It is "shiftjisx0213"!  My excuse, if  
there is any, is that I copied "shiftjisx0123" from <http://
search.cpan.org/~dankogai/Encode-JIS2K-0.02/JIS2K.pm>, under ABSTRACT  
("Canonical")....

>> -------
>>
[quoted text clipped - 10 lines]
>
> Don't know if there are any shortcut tools for it.

Thank you.  I will try to study a little more on this problem.

Best regards,

Nobumi Iyanaga
Tokyo,
Japan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.