|We don't bite newbies here... much|
Re: Problem with utf8 after nearly 4096 bytesby gvieira (Initiate)
|on Sep 07, 2013 at 23:07 UTC||Need Help??|
I'm reviving this discussion because I'm so much closer of the solution.
I finally discovered what is the real problem: Perl only recognizes the first 4096 bytes as utf8 because only the first block of text have the BOM. So he thinks that the first block is utf8 (and it goes ok) but recognizes all the other blocks as Unicode. So if I put a few en dashs ("–") I can force the code to interpretate Unicode as utf8. Buuuut, I can't expect that the users to put these en dashs. The program will be used by some oldschool Linguistics researchers, with almost none computer knowledge.
I tryed to force dashs by concatenating each line of the file with an en dash:
But I get this error:
Wide character in print at (eval 12) line 94.
Any idea of how could I force this (or another) character to make perl understand that the block is in utf8? If there's any other way to do it, would be awesome too.