in reply to Re: qq sql - umlaut isssue
in thread qq sql - umlaut isssue

UTF8 format is used already and this is not a problem. the problem is as described below

In the below SQL when i use the table name ($updatetable)as variable inside 'qq' for update it is displaying junk.

push @arraysql, qq{ UPDATE $updatetable a SET sometext = 'üseable term' where .... };

however when i use the table name direclty inside 'qq' the umlaut character is updated correctly.

push @arraysql, qq{ UPDATE user.updatetable a SET sometext = 'üseable term' where .... };

Replies are listed 'Best First'.
Re^3: qq sql - umlaut isssue
by tobyink (Canon) on Jul 30, 2012 at 10:04 UTC

    UTF8 format is used already

    But is it used everywhere as I suggested?

    I concur with the anonymous monk above that $updatetable is probably not a utf8 character string, but a byte string. Where has that variable come from? Was it read from a file? If so, have you checked that the file was opened in utf8 mode?

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
Re^3: qq sql - umlaut isssue
by Anonymous Monk on Jul 30, 2012 at 09:12 UTC

    I have a hunch. This is Perl's Unicode support messing it up. Perl says $updatetable is a character string (i.e. Unicode), and your string literal is a byte string (or vice versa), and when you try to combine them, Perl tries to upgrade both to character strings. How do you set $updatetable? Are you using the use utf8; pragma?

Re^3: qq sql - umlaut isssue
by chacham (Prior) on Jul 30, 2012 at 10:55 UTC

    If you are pushing a variable as a quoted character into an array, how does the variable get replaced with the actual value?