You are here: Foswiki>Tasks Web>Item5133 (05 Jul 2015, GeorgeClark)Edit Attach

Item5133: Can't save multibyte char names

pencil
Priority: Normal
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Engine
Component: I18N
Branches:
Reported By: TWiki:Main.PeterThoeny
Waiting For:
Last Change By: GeorgeClark
Attach a file with multibyte names (such as 中文.jpg) as listed in this screenshot:

filenames.png

This produces the following error

Use of uninitialized value in hash element at (eval 98) line 3.
 at /home/twiki4/twikisvn/lib/TWiki/UI.pm line 84
   TWiki::UI::__ANON__('Use of uninitialized value in hash element at (eval 98) line 3.\x{a}') called at (eval 98) line 3
   CGI::tmpFileName('CGI=HASH(0x8c84e3c)', '\x{ff}\x{d8}\x{ff}\x{e0}\x{0}\x{10}JFIF\x{0}\x{1}\x{1}\x{1}\x{0}`\x{0}`\x{0}\x{0}\x{ff}\x{db}\x{0}C\x{0}\x{8}\x{6}\x{6}\x{7}\x{6}\x{5}\x{8}\x{7}\x{7}\x{7}\x{9}\x{9}\x{8}\x{a}\x{c}\x{14}\x{d}\x{c}\x{b}\x{b}\x{c}\x{19}\x{12}\x{13}\x{f}\x{14}\x{1d}\x{1a}\x{1f}\x{1e}\x{1d}\x{1a}\x{1c}\x{1c} $...') called at /home/twiki4/twikisvn/lib/TWiki/UI/Upload.pm line 193
   TWiki::UI::Upload::upload('TWiki=HASH(0x8c9b7f0)') called at /home/twiki4/twikisvn/lib/TWiki/UI.pm line 159
   TWiki::UI::__ANON__() called at /home/twiki4/twikisvn/lib/CPAN/lib//Error.pm line 379
   eval {...} called at /home/twiki4/twikisvn/lib/CPAN/lib//Error.pm line 371
   Error::subs::try('CODE(0x8c84d40)', 'HASH(0xb7b77d98)') called at /home/twiki4/twikisvn/lib/TWiki/UI.pm line 197
   TWiki::UI::run('CODE(0x8e80194)') called

Reported by Dai Luogeng. I could reproduce it here in the LitterTray web. Due to chicken and egg problem I can't attach the file here for others to reproduce the issue.

-- TWiki:Main/PeterThoeny - 14 Dec 2007

If it is possible to zip the file into a non-multibyte filename that might be a workaround for the upload.

-- TWiki:Main.SteffenPoulsen - 15 Dec 2007

That is the same stack dump as for Item5130; it may be nothing to do with multibyte.....

CC

I fixed Item5130; it may or may not have cured this issue. Peter, since you can reproduce this problem, could you check please?

CC

I just tried it here on this topic. No luck:
Use of uninitialized value in hash element at (eval 98) line 3.
 at /home/twiki4/twikisvn/lib/TWiki/UI.pm line 84
   TWiki::UI::__ANON__('Use of uninitialized value in hash element at (eval 98) line 3.\x{a}') called at (eval 98) line 3
   CGI::tmpFileName('CGI=HASH(0x8c28e3c)', '\x{ff}\x{d8}\x{ff}\x{e0}\x{0}\x{10}JFIF\x{0}\x{1}\x{1}\x{1}\x{0}`\x{0}`\x{0}\x{0}\x{ff}\x{db}\x{0}C\x{0}\x{8}\x{6}\x{6}\x{7}\x{6}\x{5}\x{8}\x{7}\x{7}\x{7}\x{9}\x{9}\x{8}\x{a}\x{c}\x{14}\x{d}\x{c}\x{b}\x{b}\x{c}\x{19}\x{12}\x{13}\x{f}\x{14}\x{1d}\x{1a}\x{1f}\x{1e}\x{1d}\x{1a}\x{1c}\x{1c} $...') called at /home/twiki4/twikisvn/lib/TWiki/UI/Upload.pm line 193
   TWiki::UI::Upload::upload('TWiki=HASH(0x8c3f7a0)') called at /home/twiki4/twikisvn/lib/TWiki/UI.pm line 159
   TWiki::UI::__ANON__() called at /home/twiki4/twikisvn/lib/CPAN/lib//Error.pm line 379
   eval {...} called at /home/twiki4/twikisvn/lib/CPAN/lib//Error.pm line 371
   Error::subs::try('CODE(0x8c28d40)', 'HASH(0xb7ad4110)') called at /home/twiki4/twikisvn/lib/TWiki/UI.pm line 197
   TWiki::UI::run('CODE(0x8e240dc)') called

-- TWiki:Main.PeterThoeny - 15 Dec 2007

erm, that shouldn't be possible. I put a try..catch around the call to tmpFileName, so the exception should have been caught. Therefore the code you tried it on was not the code I checked in.

Later: probably due to my doing other things on d.t.o, the svn update had failed after my checkin so you were testing the wrong code. Note that I didn't fix it. The multibyte filename won't work (looks like it's a limitation in CGI) but at least it shouldn't crash.

Yet another UTF-8 lmitation frown, sad smile

CC

Topic was corrupted due to UTF8 problems. Restored from old rev. Kenneth, in answer to your question my fix was checked in and merged to 04x02 in Item5130. However it is just a patch over the symptom. The real problem has not been fixed yet.


Already fixed. Can be closed.

-- JozefMojzis - 24 Jun 2015

ItemTemplate edit

Summary Can't save multibyte char names
ReportedBy TWiki:Main.PeterThoeny
Codebase
SVN Range TWiki-4.3.0, Sun, 25 Nov 2007, build 15790
AppliesTo Engine
Component I18N
Priority Normal
CurrentState Closed
WaitingFor
Checkins TWikirev:16002 TWikirev:16001
TargetRelease major
ReleasedIn 2.0.0
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release01x01Checkins
Topic attachments
I Attachment Action Size Date Who Comment
filenames.pngpng filenames.png manage 16 K 14 Dec 2007 - 19:15 UnknownUser  
Topic revision: r13 - 05 Jul 2015, GeorgeClark - This page was cached on 24 May 2016 - 17:02.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License