Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: unmappable character (0x98) for 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'
}
like image 812
GRbI3yH Avatar asked Jul 11 '18 07:07

GRbI3yH


2 Answers

Setting encoding option for Java compilation should help:

compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = 'UTF-8'
like image 154
Nolequen Avatar answered Oct 23 '22 02:10

Nolequen


As an 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...:

enter image description here

by adding, e.g.:

-Dfile.encoding=UTF-8

Help | Edit Custom VM Options, then restart IntelliJ IDEA.

like image 1
invzbl3 Avatar answered Oct 23 '22 02:10

invzbl3