EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Using accented characters in Box storage object names

Posted: 08/08/2016 11:16:21
by Paolo Righi (Standard support level)
Joined: 02/15/2008
Posts: 34

Dear support,

I tried to upload a file whose name contains accented characters.
What I get is an object with a name like this:
If I change the PerformPost function call replacing the Filename parameter with URLEncode(Filename) expression then the file name is like the original but with accented characters replaced by the "%xx%xx" format.
Can this be solved in some way?

Best Regards.
Paolo Righi.
Posted: 08/09/2016 08:38:33
by Eugene Mayevski (Team)

Try to encode filenames with UTF8 yourself before uploading, then they won't be converted.

Sincerely yours
Eugene Mayevski
Posted: 08/10/2016 07:02:39
by Paolo Righi (Standard support level)
Joined: 02/15/2008
Posts: 34

Hi Eugene,

thank you for your answer.
In the meanwhile I found a working solution.
I changed the TElHTTPSClient.EncodeFieldValue to convert to UTF8 this way:

function TElHTTPSClient.EncodeFieldValue(const Value: string; const Charset : string): string;
if not NeedsEncoding then
Result := Value
ConvertUTF16toUTF8(Value, Tmp, lenientConversion, false); <<
Result := StringOfBytes(Tmp); <<
Exit; <<
{$ifdef SB_ANSI_VCL}

What do you think?

Best regards.
Paolo Righi.
Posted: 08/10/2016 17:49:28
by Eugene Mayevski (Team)

Altering the source code can lead to unpredictable bugs in other scenarios.

Unfortunately it's not clear from your messages, what (unicode or non-unicode) strings you manipulate in this case, and, consequently, it's not clear, why (and if correctly) the name is converted.

Sincerely yours
Eugene Mayevski



Topic viewed 743 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!