Dear Monks

I am really struggling since days with unicode directory names, for example "Małretuzz" (both Activestate and Strawberry, W7). What is wrong with this?

use utf8; use Win32; $dir="Małretuzz"; print our $short_path_dir = Win32::GetShortPathName( "$dir" );

This gives me a not initialized value.

What I am trying to do is to get a directory name (and path) from a Tk GUI. In this directory I'll create a sqlite database. If the directory contains not english characters...it doesn't work. I've search Perlmonks, I've found suggestions with different Win32s, nothing work here...

use utf8; use Win32; use Tk; use File::Spec; my $dir = File::Spec->canonpath( $mw->chooseDirectory() ); my $short_path_dir=Win32::GetANSIPathName($dir); #alternative #my $short_path_dir = Win32::GetShortPathName( "$dir" ); my $path_and_database="$short_path_dir" . "\\DATABASE\.db"; my $dbh = DBI->connect("dbi:SQLite:$path_and_database","","", {}); $dbh->do( "CREATE TABLE table( ID INTEGER PRIMARY KEY, POS, simple)" ) +; $dbh->disconnect;

In reply to directory unicode by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.