commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julius Davies (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CODEC-140) isBase64 returns true for any UTF8 string
Date Wed, 25 Apr 2012 21:56:18 GMT

    [ 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

       

Mime
View raw message