Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect from FileItem not working #20

Open
GoogleCodeExporter opened this issue Jan 25, 2016 · 0 comments
Open

Detect from FileItem not working #20

GoogleCodeExporter opened this issue Jan 25, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. if I use a fileinputstream it detects fine, if i use FileItem always detect 
maccrylic
2. atach you can see the example file
3.
 here is the peace of code:
BufferedWriter clsWriter = new BufferedWriter ( new OutputStreamWriter ( 
clsFile.getOutputStream () ) );

        clsWriter
                .write ( "ÄÜÖßäöü,Name1ÄÜÖßäöü,Name2ÄÜÖßäöü,Name3ÄÜÖßäöü,StreetÄÜÖßäöü,MÄÜÖßäöü,DE,80080,München,ContactÄÜÖßäöü,+49(0)ÄÜÖßäöü,ÄÜÖßäöü@gls-itservices.com,CommentÄÜÖßäöü,+49,(0)98,765,432,BlÄÜÖßäöü" );

        clsWriter.close ();

        InputStream clsInput = clsFile.getInputStream ();
        byte[] buffer = new byte[ 1024 ];

        while ( true )
        {
            int n = clsInput.read ( buffer );

            if ( n <= 0 )
            {
                break;
            }

            detector.handleData ( buffer, 0, n );

        }

        detector.dataEnd ();

        clsInput.close ();

        String strEncoding = detector.getDetectedCharset ();

        System.out.println ( "encoding: " + strEncoding );


What is the expected output? What do you see instead?
I expect latin-1

What version of the product are you using? On what operating system?
juniversalchardet-1.0.3.jar windowsxp

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 23 Jul 2014 at 3:31

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant