idea 12 parse some chinese character error

hi,all:
     Today, I download idea 12,then I install and run it. When i run junit test on my existent project, i got below error:
Caused by: org.dom4j.DocumentException: Invalid byte 1 of 1-byte UTF-8 sequence. Nested exception: Invalid byte 1 of 1-byte UTF-8 sequence.
 at org.dom4j.io.SAXReader.read(SAXReader.java:484)
 at org.dom4j.io.SAXReader.read(SAXReader.java:343)
 at com.taobao.ad.enginenotify.NotifyFacadeImpl.loadNotifyConfig(NotifyFacadeImpl.java:101)
 at com.taobao.ad.enginenotify.NotifyFacadeImpl.afterPropertiesSet(NotifyFacadeImpl.java:37)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
 at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
 ... 95 more


Some exception stack infomation is ignored. These exceptions make me puzzled, because I don't change any code,and that code run correctly before. So I run idea 11, and run the same test case, it pass.....
  After some time debug, I find  the chinese charactor "牌"--- utf-8 code is "E7 89 8C" make this exception.
Can somebody fix it? Thank you, forgive my poor english.:)
0

Hello.

Please, check Settings / File encodings: IDE Encoding and Project Default Encoding. Do they match the actual encoding of the file in question?

Regards,
Alexander.

0
Avatar
Permanently deleted user

it happened to me too.

I set Settings / File encodings to utf-8. xml file encoding also is utf-8. xml' content starting with "<?xml version="1.0" encoding="UTF-8"?>".

when build project, IDEA generate source file happened errors. some chinese character is chaos.
but after change xml file encoding attritue from UTF-8 to gbk, xml file encoding not change, building project,  IDEA generate source file is correct.

when use IDEA11, everything well done.

ps:My project is maven project.

0

> IDEA generate source file
Do you mean you run some Maven goal generating sources?

Regards,
Alexander.

0
Avatar
Permanently deleted user

I got this error too ,it's back to normal when I delete all chinese character in xml file . My project is a maven project too.

ERROR in ch.qos.logback.core.joran.event.SaxEventRecorder@1fef80a - I/O error occurred while parsing xml file com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: Invalid byte 3 of 3-byte UTF-8 sequence.

0
Avatar
Permanently deleted user

No.I use "Build Project" button.

0
Avatar
Permanently deleted user

Please create corresponding ticket at the IJ tracker with a sample project attached to it.

Denis

0
Avatar
Permanently deleted user

Thanks Denis. I got it. Maven filter caught this problem. when remove Maven filter, all passed. IDEA maven bug?

          <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*.*</include>
                </includes>
            </resource>
        </resources>

0
Avatar
Permanently deleted user

thanks backkom, that work.

0
Avatar
Permanently deleted user

I'm afraid I don't quite understand what exactly happened - do you say that maven filtering plugin inserted chinese characters in incorrect encoding during the processing?

Denis

0
Avatar
Permanently deleted user

I think it is the problem . idea 11 is normal.

0
Avatar
Permanently deleted user

Denis, hope attach will help you.



Attachment(s):
test.rar.zip
0
Avatar
Permanently deleted user

Sorry for disappear some days.
backkom sun  provide the solution works!!!! I remove the <filtering>true</filtering> ,then run test case , everything is ok!!!
I guess it is a IDEA maven plugin's bug.

0
Avatar
Permanently deleted user

Sorry but the project you attached contains just an xml file with chinese character. It's also not clear what do you do to see the problem. Please provide exact information on what should be done in order to reproduce it locally.

Denis

0
Avatar
Permanently deleted user

the zip file is a simple maven project,just a Test.java class,a xml file contain a chinese charactor “牌”. Run the main method, you will
see the error.Then you can delete pom.xml 23 line:<filtering>true</filtering> , run main method, it pass....



Attachment(s):
idea.zip
0
Avatar
Permanently deleted user

Still unable to reproduce that.

How do you run the Test class? Via 'Run Test.main()' context menu action? Provide a screenshot of your run configuration - is there some action at 'before make' section?

Denis

0
Avatar
Permanently deleted user

I run Test.class by right hit mouse, select the 'Run 'Test.main()'' in the popup menu.
btw, my maven version is 2.2.1

0
Avatar
Permanently deleted user

Please provide screenshot of a run configuration that is auto-created when you do right click -> 'Run Test.main()'. Provide a screenshot of your compiler settings as well - Project Settings | Compiler. The last question is if the problem reproduced under IJ 11?

Denis

0
Avatar
Permanently deleted user

I've reproduced the problem eventually. Feel free to track this ticket's progess - IDEA-97558.

Denis

0
Avatar
Permanently deleted user

thank you very much. idea 11 does not have this problem.

0
Avatar
Permanently deleted user

Denis Zhdanov , I see in the IDEA-97558 you provide a picture that you set project default encoding is utf-32. But I see that setting in my idea,  it is blank. Could you tell me why? Thanks.
idea bug.jpg

0
Avatar
Permanently deleted user

I manually configured the project to use encoding over than utf-8 in order to reproduce the problem.

Denis

0
Avatar
Permanently deleted user

The problem has been introduced to the 'out-of-process' compiler. You can switch to the 'in-process' compiler as a temporary solution.

Denis

0
Avatar
Permanently deleted user

then as my idea, the blank encoding mean which encoding? System default?

0
Avatar
Permanently deleted user

Yes

0
Avatar
Permanently deleted user

How can I switch to 'in-process' setting  compiler  in IDEA 12?

0
Avatar
Permanently deleted user

Its managed via 'Use external build' checkbox at the compiler settings.

Denis

0

请先登录再写评论。