Basil A. Daoust <> wrote:
> Basil A. Daoust wrote:
>
>> Hi,
>> I've run into a problem.
>> I have a data file that contains strings like
>> [- Ω -] - [ Omega ] In case its messed up when I post this [◄●►] - [
>> <
>> o > ] dark filled in shapes.
>> As well it contains non-displayed chars that seems to have a ord
>> value
>> of 160.
>>
>> Anyway the web pages save fine, they also display fine in word and
>> notepad. If I try and read/write them with perl however things turn
>> bad.
>> The Omega symbol seems to be ord 937 which prints as Ω Using a hash
>> I mapped one file, which of course doesn't include all special chars
>> but
>> it shows the problem.
>> Here is the last part of the table.
>> Char y ==> 121
>> Char z ==> 122
>> Char { ==> 123
>> Char } ==> 125
>> Char ~ ==> 126
>> Char   ==> 160
>> Char Ω ==> 937
>> Char Γû║ ==> 9658
>> Char Γùä ==> 9668
>> Char ΓùÅ ==> 9679
>>
>> I added the following use to remove the "wide char errors" when
>> printing. use open ':utf8'; binmode(STDOUT, ":utf8");
>>
>> But really how can I know what the right unicode set is.
>> How can I get them to print correctly to a file is fine, and how can
>> I
>> get that files saved as a unicode instead of ascii?
>>
>> In Windows I can save a file as Unicode or UTF-8 what would be the
>> perl equivalent to unicode?
>>
>> thanks in advance
>>
>>
>>
> Well maybe ya all no a better solution, but I found one that works on
> Windows XP. a) switch the console from default font to a TT font,
> and save it as the new default for all command windows. b) add
> `chcp 65001` to the beginning of the perl script that needs unicode
> support, chcp changes the code page, 65001 is utf-8.
>
> Char ==> 160
> Char Ω ==> 937
> Char ► ==> 9658
> Char ◄ ==> 9668
> Char ● ==> 9679
Your solution seems to be to get the console to display UTF8 correctly by
setting its font and code page. If it works, this indicates that the output
from the Perl script is UTF8. Its not clear what your problem is, as it doesn't
seem to be with the Perl script.
You have read Perl's unicode documentation (e.g. 'perldoc uniintro' 'perldoc
unicode' ...)?
Also, charnames::viacode(160) returns "NO-BREAK SPACE" (see 'perldoc
charnames').
HTH
--
Brian Raven
=========================================
Atos Euronext Market Solutions Disclaimer
=========================================
The information contained in this e-mail is confidential and solely for the
intended addressee(s). Unauthorised reproduction, disclosure, modification,
and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediately
and delete it from your system. The views expressed in this message do not
necessarily reflect those of Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited - Registered in England & Wales with
registration no. 3962327. Registered office address at 25 Bank Street London
E14 5NQ United Kingdom.
Atos Euronext Market Solutions SAS - Registered in France with registration no.
425 100 294. Registered office address at 6/8 Boulevard Haussmann 75009 Paris
France.
L'information contenue dans cet e-mail est confidentielle et uniquement
destinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee.
Toute copie, publication ou diffusion de cet email est interdite. Si cet e-mail
vous parvient par erreur, nous vous prions de bien vouloir prevenir
l'expediteur immediatement et d'effacer le e-mail et annexes jointes de votre
systeme. Le contenu de ce message electronique ne represente pas necessairement
la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Société de droit anglais, enregistrée au
Royaume Uni sous le numéro 3962327, dont le siège social se situe 25 Bank
Street E14 5NQ Londres Royaume Uni.
Atos Euronext Market Solutions SAS, société par actions simplifiée, enregistré
au registre dui commerce et des sociétés sous le numéro 425 100 294 RCS Paris
et dont le siège social se situe 6/8 Boulevard Haussmann 75009 Paris France.
=========================================
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs