You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Julius Davies (JIRA)" <ji...@apache.org> on 2012/04/25 23:56:18 UTC

[jira] [Commented] (CODEC-140) isBase64 returns true for any UTF8 string

    [ https://issues.apache.org/jira/browse/CODEC-140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13262165#comment-13262165 ] 

Julius Davies commented on CODEC-140:
-------------------------------------

"Hello" is a valid Base64 encoding.   Not all UTF-8 strings return true.  Consider the following:

{code}
    /*
      Prints the following:

      Hello: true
      Olé!   false
      Hello! false
    */
    System.out.println("Hello: " + Base64.isBase64("Hello"));
    System.out.println("Olé!   " + Base64.isBase64("Olé!"));
    System.out.println("Hello! " + Base64.isBase64("Hello!"));
{code}
                
> isBase64 returns true for any UTF8 string
> -----------------------------------------
>
>                 Key: CODEC-140
>                 URL: https://issues.apache.org/jira/browse/CODEC-140
>             Project: Commons Codec
>          Issue Type: Bug
>    Affects Versions: 1.6
>         Environment: windows/linux
>            Reporter: Mohit Anchlia
>
> I just called Base64.isBase64("Hello") for instance and it returns true. I thought it would return true only if it is valid base64 encoded string.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira