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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |