简体   繁体   English

从AWS Elastic Transcoder获得SQS队列消息时,保留字符将用“ _”替换

[英]Reserved Characters are replaced with “_” when get a SQS Queue message from AWS Elastic Transcoder

I am using Java 8 and aws-java-sdk-s3 version 1.11.251. 我正在使用Java 8和aws-java-sdk-s3版本1.11.251。 When I use a reserved characters in filename. 当我在文件名中使用保留字符时。 The SQS returns the inputKey as encoded format like the following, SQS将inputKey作为编码格式返回,如下所示,

Original File name: video-test4!!.mp4 原始文件名: video-test4 !!。mp4
Received File name from SQS: video-test4%21%21.mp4 从SQS接收的文件名: video-test4%21%21.mp4

When I use Square Brackets "[", "]", it replace with "_". 当我使用方括号“ [”,“]”时,将其替换为“ _”。 Why its returns like the following, 为什么它的返回如下所示,

Original File name: test[].mp4 原始文件名: test []。mp4
Received File name from SQS: test__.mp4" 从SQS接收的文件名: test __。mp4“

How to decode the "test__.mp4" to test[].mp4? 如何将“ test __。mp4”解码为test []。mp4?

Kindly provide your inputs. 请提供您的输入。

Since [ and ] are both converted into _ , there's no recovering what the original characters had been -- information has been lost. 由于[]都被转换为_ ,因此无法恢复原始字符-信息已丢失。

That said, you really shouldn't be using either [ or ] as characters in a file name. 就是说,您实际上不应该在文件名中使用[]作为字符。 It appears this particular SDK is forcing you to use only file names built out of characters that are universally acceptable as valid file name characters in all major OSes. 似乎该特定的SDK迫使您仅使用由所有主要操作系统中普遍认可的有效文件名字符组成的文件名。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM