I have a problem with the assembly of the project:
D:...\\Main.java:112: error: unmappable character (0x98) for encoding windows-1251
robot.getBrowserControl().findElement(By.xpath("//div[.='НАПИСАТЬ']")).click();
This error in line: robot.getBrowserControl().findElement(By.xpath("//div[.='НАПИСАТЬ']")).click();
Images: error , IDEA settings . Ths bottom-right is selected UTF-8. I'm not sure, but maybe it's like the symbol "И"
This my gradle file
plugins {
id 'java'
}
group 'ru.grbi3yh.processthesefiles'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
jar {
baseName = 'ProcessthFiles'
}
apply plugin: 'application'
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version: '2.41.0'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.7'
}
I don't know if I am too late for this problem (pretty sure yes) but my advise could help to other guys - the problem is in cyrillic symbols. I had the same problem and I solved that by saving the file using format ANSI (if you use use some text editor like notepad, you can save your fie in ANSI encoding. Perhaps this option should be in IDE)
Setting encoding option for Java compilation should help:
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
As alternative way to solve this error:
"error: unmappable character (0x98) for encoding windows-1251"
you can also change the default encoding inside Custom VM Options...
:
by adding, eg:
-Dfile.encoding=UTF-8
Help | Edit Custom VM Options, then restart IntelliJ IDEA.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.