Characters that are invalid in metadata

2

Hi, I'm trying to upload a file in the Firebase Storage, the problem is that adding a StorageMetadata with a "name" field that contains "Muñoz" fails me and it's because I think it contains an invalid metadata character that is the "ñ". I would like to know how I can pass this word to a valid format. Thanks

This is the piece of code:

StorageMetadata metadata = new StorageMetadata.Builder()
.setCustomMetadata("avatar",mFirebaseUser.getPhotoUrl().toString())
.setCustomMetadata("nombre","Muñoz")
                .setContentType("image/jpg")
                .build();

        imgRef.putFile(fileUri,metadata)
    
asked by Donis 07.09.2016 в 18:43
source

1 answer

1

use setContentEncoding () to define the code as UTF-8:

.setContentEncoding("UTF-8")
    
answered by 07.09.2016 в 21:36