mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Partial fix for AWC-999: Content upload guesses character encoding and offers the user the chance to change it.
TODO: Fix the "Modify Content Properties" to include the encoding as a changeable option. Modified other entry points of content into the system. All calls to ContentWriter.setEncoding("UTF-8") need some serious examination. It is no longer necessary to assume anything about the encoding. The worst case scenario is that we guess the encoding from the stream without giving the user the chance to change it. This works for most non-interactive scenarios like CIFS, WebDAV and FTP, now. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6113 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -79,11 +79,15 @@ public class ContentCharsetFinder
|
|||||||
*
|
*
|
||||||
* @param is a stream that will not be affected by the call, but must
|
* @param is a stream that will not be affected by the call, but must
|
||||||
* support marking
|
* support marking
|
||||||
* @param mimetype the mimetype of the stream data
|
* @param mimetype the mimetype of the stream data - <tt>null</tt> if not known
|
||||||
* @return returns a characterset and never <tt>null</tt>
|
* @return returns a characterset and never <tt>null</tt>
|
||||||
*/
|
*/
|
||||||
public Charset getCharset(InputStream is, String mimetype)
|
public Charset getCharset(InputStream is, String mimetype)
|
||||||
{
|
{
|
||||||
|
if (mimetype == null)
|
||||||
|
{
|
||||||
|
return defaultCharset;
|
||||||
|
}
|
||||||
// Is it text?
|
// Is it text?
|
||||||
if (!mimetypeService.isText(mimetype))
|
if (!mimetypeService.isText(mimetype))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user