in reply to Date::Manip and German months names

$$d{"month_abb"}= [["Jan","Feb","Mar","Apr","Mai","Jun", "Jul","Aug","Sep","Okt","Nov","Dez"], ["J${a}n","Feb","M${a}r","Apr","Mai","Jun", "Jul","Aug","Sep","Okt","Nov","Dez"]];
Update: Make sure your a thingy is \xe4
$$hash{"a:"} = "\xe4"; # LATIN SMALL LETTER A WITH DIAERESIS


Evan Carroll
I hack for the ladies.
www.EvanCarroll.com

Replies are listed 'Best First'.
Re^2: Date::Manip and German months names
by almut (Canon) on Jul 09, 2008 at 19:33 UTC
    The source wants the abbreviation Mar

    Not sure. As I'm reading the source, it should (or is trying to) also support "Mär", as set up by the "M${a}r"$a is defined as

    my(%h)=(); _Char_8Bit(\%h); my($a)=$h{"a:"};

    with the routine _Char_8Bit() mapping "a:" to the char \xe4

    sub _Char_8Bit { my($hash)=@_; ... $$hash{"a:"} = "\xe4"; # LATIN SMALL LETTER A WITH DIAERESIS ... }

    In other words, "M${a}r" corresponds to ISO Latin "Mär". So it should work, I think.

      I think he is just not encoding properly try to use Encode::encode_utf8
      perl -MEncode -Mutf8 -E'say 1 if encode_utf8("ä") eq encode_utf8("\xe4 +");' perl -MEncode -Mutf8 -E'say 1 if "ä" eq encode_utf8("\xe4");'


      Evan Carroll
      I hack for the ladies.
      www.EvanCarroll.com
        A reply falls below the community's threshold of quality. You may see it by logging in.
Re^2: Date::Manip and German months names
by ikegami (Patriarch) on Jul 09, 2008 at 19:30 UTC

    I tried using \xE4.
    I tried byte 0xE4 (iso-latin-1).
    I tried bytes 0xC3 0xA4 (utf-8) with "use utf8;".
    I tried bytes 0xC3 0xA4 (utf-8) without "use utf8;" (shouldn't work).
    I tried utf8::upgrade($date_in)
    I tried utf8::downgrade($date_in).

    None worked.

    I'd contact the author. It's obvious that he intends one of those to work.

    Update: Added last two, but they are redundant with earlier tests in this case.