java/ gradle/ intellij-idea/ encoding/ windows-1251

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 "И"

img errors

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.

Related Question Maven error: unmappable character for encoding Cp1251 Error when compiling: unmappable character (0x90D) for encoding windows-1252 Encoding error - unmappable character for encoding ASCII "Unmappable character for encoding UTF-8" error Javadoc error: unmappable character for encoding ASCII Eclipse, error: unmappable character for encoding GBK error: unmappable character for encoding UTF-8 for databinding Solving error: unmappable character for encoding UTF8 Unmappable character for encoding Windows-1251 to UTF-8 codes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM