shreedara75 has asked for the wisdom of the Perl Monks concerning the following question:
I am trying insert a German Text with German Alphabet in an Excel Cell. however what i have stored in a variable and what is printed in XL Cell are different. i assume it is something to do with character encoding. i tried few things but could not figure out a way to insert proper German string in XL. below is my code.
but in XL B2-B4 cells has the following string#!/usr/bin/perl use warnings; #use strict; use Encode qw(encode decode); my $enc = 'utf-8'; my $germanText = 'Fräsen und ndk (Kamera - Fräsaufnahme)'; my $germ_str = decode($enc, $germanText); my $g8txt = encode($enc, $germanText); print encode($enc, $germanText); print encode($enc, $germ_str); $xl_form = "C:/tmp/german.xls"; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); $Excel->{DisplayAlerts} = 1; $Book = $Excel->Workbooks->Open($xl_form); $Sheet = $Book->Worksheets("DRC"); $Sheet->Range("B2")->{Value} = $germanText; $Sheet->Range("B3")->{Value} = $germ_str; $Sheet->Range("B4")->{Value} = $g8txt;
B2 = Fräsen und ndk (Kamera - Fräsaufnahme)
B3 = Fräsen und ndk (Kamera - Fräsaufnahme)
B4 = Fräsen und ndk (Kamera - Fräsaufnahme)
how do i insert German text properly in XL?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: german Alphabet
by ikegami (Patriarch) on Dec 04, 2018 at 06:30 UTC | |
Re: german Alphabet
by thanos1983 (Parson) on Dec 04, 2018 at 12:27 UTC | |
Re: german Alphabet
by 1nickt (Canon) on Dec 04, 2018 at 12:52 UTC | |
by ikegami (Patriarch) on Dec 05, 2018 at 09:12 UTC | |
by Aldebaran (Curate) on Dec 04, 2018 at 20:35 UTC | |
by haukex (Archbishop) on Dec 04, 2018 at 21:02 UTC | |
by ikegami (Patriarch) on Dec 05, 2018 at 09:19 UTC | |
by Anonymous Monk on Dec 15, 2018 at 19:51 UTC | |
| |
by Aldebaran (Curate) on Dec 07, 2018 at 23:44 UTC | |
by ikegami (Patriarch) on Dec 08, 2018 at 06:14 UTC | |
by Aldebaran (Curate) on Dec 12, 2018 at 00:27 UTC |
Back to
Seekers of Perl Wisdom