Меню

Unmappable character for encoding utf 8 ошибка

You have encoding problem with your sourcecode file. It is maybe ISO-8859-1 encoded, but the compiler was set to use UTF-8. This will results in errors when using characters, which will not have the same bytes representation in UTF-8 and ISO-8859-1. This will happen to all characters which are not part of ASCII, for example ¬ NOT SIGN.

You can simulate this with the following program. It just uses your line of source code and generates a ISO-8859-1 byte array and decode this «wrong» with UTF-8 encoding. You can see at which position the line gets corrupted. I added 2 spaces at your source code to fit position 74 to fit this to ¬ NOT SIGN, which is the only character, which will generate different bytes in ISO-8859-1 encoding and UTF-8 encoding. I guess this will match indentation with the real source file.

 String reg = "      String reg = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[~#;:?/@&!"'%*=¬.,-])(?=[^\s]+$).{8,24}$";";
 String corrupt=new String(reg.getBytes("ISO-8859-1"),"UTF-8");
 System.out.println(corrupt+": "+corrupt.charAt(74));
 System.out.println(reg+": "+reg.charAt(74));     

which results in the following output (messed up because of markup):

String reg = «^(?=.[0-9])(?=.[a-z])(?=.[A-Z])(?=.[~#;:?/@&!»‘%*=�.,-])(?=[^s]+$).{8,24}$»;: �

String reg = «^(?=.[0-9])(?=.[a-z])(?=.[A-Z])(?=.[~#;:?/@&!»‘%*=¬.,-])(?=[^s]+$).{8,24}$»;: ¬

See «live» at https://ideone.com/ShZnB

To fix this, save the source files with UTF-8 encoding.

I’m currently working on a Java project that is emitting the following warning when I compile:

/src/com/myco/apps/AppDBCore.java:439: warning: unmappable character for encoding UTF8
    [javac]         String copyright = "� 2003-2008 My Company. All rights reserved.";

I’m not sure how SO will render the character before the date, but it should be a copyright symbol, and is displayed in the warning as a question mark in a diamond.

It’s worth noting that the character appears in the output artifact correctly, but the warnings are a nuisance and the file containing this class may one day be touched by a text editor that saves the encoding incorrectly…

How can I inject this character into the «copyright» string so that the compiler is happy, and the symbol is preserved in the file without potential re-encoding issues?

asked Jan 21, 2009 at 11:17

seanhodges's user avatar

1

Try with:
javac -encoding ISO-8859-1 file_name.java

answered Oct 24, 2009 at 20:59

Fernando Nah's user avatar

Fernando NahFernando Nah

1,0211 gold badge7 silver badges2 bronze badges

7

Use the «uxxxx» escape format.

According to Wikipedia, the copyright symbol is unicode U+00A9 so your line should read:

String copyright = "u00a9 2003-2008 My Company. All rights reserved.";

answered Jan 21, 2009 at 11:20

Jon Skeet's user avatar

Jon SkeetJon Skeet

1.4m850 gold badges9042 silver badges9132 bronze badges

7

If you’re using Maven, set the <encoding> explicitly in the compiler plugin’s configuration, e.g.

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.2</version>
            <configuration>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>

answered May 28, 2012 at 14:27

Thomas Leonard's user avatar

Thomas LeonardThomas Leonard

7,0182 gold badges36 silver badges40 bronze badges

3

put this line in yor file .gradle above the Java conf.

apply plugin: 'java'
compileJava {options.encoding = "UTF-8"}   

answered Sep 13, 2015 at 23:03

Alobes5's user avatar

Alobes5Alobes5

4635 silver badges8 bronze badges

1

Most of the time this compile error comes when unicode(UTF-8 encoded) file compiling

javac -encoding UTF-8 HelloWorld.java

and also You can add this compile option to your IDE
ex: Intellij idea
(File>settings>Java Compiler) add as additional command line parameter

enter image description here

-encoding : encoding
Set the source file encoding name, such as EUC-JP and UTF-8.. If -encoding is not specified, the platform default converter is used. (DOC)

answered Apr 5, 2015 at 6:17

Alupotha's user avatar

AlupothaAlupotha

9,5204 gold badges46 silver badges48 bronze badges

Gradle Steps

If you are using Gradle then you can find the line that applies the java plugin:

apply plugin: 'java'

Then set the encoding for the compile task to be UTF-8:

compileJava {options.encoding = "UTF-8"}   

If you have unit tests, then you probably want to compile those with UTF-8 too:

compileTestJava {options.encoding = "UTF-8"}

Overall Gradle Example

This means that the overall gradle code would look something like this:

apply plugin: 'java'
compileJava {options.encoding = "UTF-8"}
compileTestJava {options.encoding = "UTF-8"}

answered Oct 21, 2018 at 10:42

Luke Machowski's user avatar

Luke MachowskiLuke Machowski

3,8152 gold badges31 silver badges28 bronze badges

This worked for me:

<?xml version="1.0" encoding="utf-8" ?>
<project name="test" default="compile">
    <target name="compile">
        <javac srcdir="src" destdir="classes" encoding="iso-8859-1" debug="true" />
    </target>
</project>

Yuri's user avatar

Yuri

4,0691 gold badge25 silver badges44 bronze badges

answered Apr 30, 2017 at 1:53

Dxx0's user avatar

For those wondering why this happens on some systems and not on others (with the same source, build parameters, and so on), check your LANG environment variable. I get the warning/error when LANG=C.UTF-8, but not when LANG=en_US.UTF-8.

answered Apr 14, 2020 at 19:07

jakar's user avatar

jakarjakar

1,0111 gold badge10 silver badges22 bronze badges

If you use eclipse (Eclipse can put utf8 code for you even you write utf8 character. You will see normal utf8 character when you programming but background will be utf8 code) ;

  1. Select Project
  2. Right click and select Properties
  3. Select Resource on Resource Panel(Top of right menu which opened after 2.)
  4. You can see in Resource Panel, Text File Encoding, select other which you want

P.S : this will ok if you static value in code. For Example String test = «İİİİİııııııççççç»;

answered Dec 7, 2009 at 7:56

bora.oren's user avatar

bora.orenbora.oren

3,3943 gold badges33 silver badges31 bronze badges

2

I had the same problem, where the character index reported in the java error message was incorrect. I narrowed it down to the double quote characters just prior to the reported position being hex 094 (cancel instead of quote, but represented as a quote) instead of hex 022. As soon as I swapped for the hex 022 variant all was fine.

answered Jun 22, 2010 at 12:14

Kelvin Goodson's user avatar

0

If one is using Maven Build from the command prompt one can use the following command as well:

                    mvn -Dproject.build.sourceEncoding=UTF-8

answered Jun 24, 2015 at 15:06

5122014009's user avatar

51220140095122014009

3,5926 gold badges24 silver badges34 bronze badges

After importing my project from eclipse into android studio i have got the following error :

Error: unmappable character for encoding UTF-8

Android Studio : 0.5.8

asked May 15, 2014 at 12:11

TooCool's user avatar

I had the same problem because there was files with windows-1251 encoding and Cyrillic comments. In Android Studio which is based on IntelliJ IDEA you can solve it in two ways:

a) convert file encoding to UTF-8 or

b) set the right file encoding in your build.gradle script:

android {
    ...
    compileOptions.encoding = 'windows-1251' // write your encoding here
    ...

To convert file encoding use the menu at the bottom right corner of IDE. Select right file encoding first -> press Reload -> select UTF-8 -> press Convert.

Also read this Use the UTF-8, Luke! File Encodings in IntelliJ IDEA

answered Jul 4, 2014 at 7:30

Mr. Blurred's user avatar

Mr. BlurredMr. Blurred

1,5091 gold badge10 silver badges7 bronze badges

6

Adding the following to build.gradle solves the problem :

android {
 ...
compileOptions.encoding = 'ISO-8859-1'
 }

HaveNoDisplayName's user avatar

answered Oct 10, 2015 at 4:45

Priyanka Dadhich's user avatar

1/ Convert the file encoding
File -> Settings -> Editor -> File encodings -> set UTF-8 for

  • IDE Encoding
  • Project Encoding
  • Default encoding propertie file

Press OK

2/ Rebuild Project

Build -> Rebuild project

answered Aug 26, 2015 at 12:13

Samy Parjou's user avatar

I have the problem with encoding in javadoc generated by intellij idea. The solution is to add

-encoding UTF-8 -docencoding utf-8 -charset utf-8

into command line arguments!

UPDATE: more information about compilation Javadoc in Intellij IDEA see in my post

answered Dec 17, 2014 at 12:18

anil's user avatar

anilanil

2,05120 silver badges35 bronze badges

Add system variable (for Windows) «JAVA_TOOL_OPTIONS» = «-Dfile.encoding=UTF8«.

I did it only way to fix this error.

answered Aug 8, 2016 at 6:58

gc986's user avatar

gc986gc986

7361 gold badge10 silver badges24 bronze badges

In Android Studio resolved it by

  1. Navigate to File > Editor > File Encodings.
  2. In global encoding set the encoding to ISO-8859-1
  3. In Project encoding set the encoding to UTF-8 and the same case to Default encoding for properties files.
  4. Rebuild project.

Machado's user avatar

Machado

8,0595 gold badges41 silver badges46 bronze badges

answered Feb 24, 2019 at 15:12

ibrahnerd7's user avatar

ibrahnerd7ibrahnerd7

111 silver badge3 bronze badges

A few encoding issues that I had to face couldn’t be solved by above solutions.
I had to either update my Android Studio or run test cases using following command in the AS terminal.

gradlew clean assembleDebug testDebug

P.S your encoding settings for IDE and project should match.

Hope it helps !

answered Jan 20, 2016 at 4:36

Rahul's user avatar

RahulRahul

8789 silver badges15 bronze badges

If above answeres did not work, then you can try my answer because it worked for me.
Here’s what worked for me.

  1. Close Android Studio
  2. Go to C:Usersyour username
  3. Locate the Android Studio settings directory named .AndroidStudioX.X (X.X being the version)
  4. C:Usersmy_user_name.AndroidStudio4.0systemcaches
  5. Delete the caches folder and open android studio

This should fix the issue.

answered Jul 28, 2020 at 0:43

Shah Nizar Baloch's user avatar

Check all ‘C’ characters. There are may be some cyrillic ‘C’s in english-looking word.
Reason for this is that in both english and russian keyboards ‘C’ occupies same physical button.

answered Nov 4, 2020 at 12:30

Waldmann's user avatar

WaldmannWaldmann

1,30310 silver badges24 bronze badges

After importing my project from eclipse into android studio i have got the following error :

Error: unmappable character for encoding UTF-8

Android Studio : 0.5.8

asked May 15, 2014 at 12:11

TooCool's user avatar

I had the same problem because there was files with windows-1251 encoding and Cyrillic comments. In Android Studio which is based on IntelliJ IDEA you can solve it in two ways:

a) convert file encoding to UTF-8 or

b) set the right file encoding in your build.gradle script:

android {
    ...
    compileOptions.encoding = 'windows-1251' // write your encoding here
    ...

To convert file encoding use the menu at the bottom right corner of IDE. Select right file encoding first -> press Reload -> select UTF-8 -> press Convert.

Also read this Use the UTF-8, Luke! File Encodings in IntelliJ IDEA

answered Jul 4, 2014 at 7:30

Mr. Blurred's user avatar

Mr. BlurredMr. Blurred

1,5091 gold badge10 silver badges7 bronze badges

6

Adding the following to build.gradle solves the problem :

android {
 ...
compileOptions.encoding = 'ISO-8859-1'
 }

HaveNoDisplayName's user avatar

answered Oct 10, 2015 at 4:45

Priyanka Dadhich's user avatar

1/ Convert the file encoding
File -> Settings -> Editor -> File encodings -> set UTF-8 for

  • IDE Encoding
  • Project Encoding
  • Default encoding propertie file

Press OK

2/ Rebuild Project

Build -> Rebuild project

answered Aug 26, 2015 at 12:13

Samy Parjou's user avatar

I have the problem with encoding in javadoc generated by intellij idea. The solution is to add

-encoding UTF-8 -docencoding utf-8 -charset utf-8

into command line arguments!

UPDATE: more information about compilation Javadoc in Intellij IDEA see in my post

answered Dec 17, 2014 at 12:18

anil's user avatar

anilanil

2,05120 silver badges35 bronze badges

Add system variable (for Windows) «JAVA_TOOL_OPTIONS» = «-Dfile.encoding=UTF8«.

I did it only way to fix this error.

answered Aug 8, 2016 at 6:58

gc986's user avatar

gc986gc986

7361 gold badge10 silver badges24 bronze badges

In Android Studio resolved it by

  1. Navigate to File > Editor > File Encodings.
  2. In global encoding set the encoding to ISO-8859-1
  3. In Project encoding set the encoding to UTF-8 and the same case to Default encoding for properties files.
  4. Rebuild project.

Machado's user avatar

Machado

8,0595 gold badges41 silver badges46 bronze badges

answered Feb 24, 2019 at 15:12

ibrahnerd7's user avatar

ibrahnerd7ibrahnerd7

111 silver badge3 bronze badges

A few encoding issues that I had to face couldn’t be solved by above solutions.
I had to either update my Android Studio or run test cases using following command in the AS terminal.

gradlew clean assembleDebug testDebug

P.S your encoding settings for IDE and project should match.

Hope it helps !

answered Jan 20, 2016 at 4:36

Rahul's user avatar

RahulRahul

8789 silver badges15 bronze badges

If above answeres did not work, then you can try my answer because it worked for me.
Here’s what worked for me.

  1. Close Android Studio
  2. Go to C:Usersyour username
  3. Locate the Android Studio settings directory named .AndroidStudioX.X (X.X being the version)
  4. C:Usersmy_user_name.AndroidStudio4.0systemcaches
  5. Delete the caches folder and open android studio

This should fix the issue.

answered Jul 28, 2020 at 0:43

Shah Nizar Baloch's user avatar

Check all ‘C’ characters. There are may be some cyrillic ‘C’s in english-looking word.
Reason for this is that in both english and russian keyboards ‘C’ occupies same physical button.

answered Nov 4, 2020 at 12:30

Waldmann's user avatar

WaldmannWaldmann

1,30310 silver badges24 bronze badges

Problem

This technote explains how to resolve an unmappable character for encoding UTF8 error, that can occur when using IBM Rational Team Concert.

Symptom

When preforming a build for Rational Team Concert, the following error is seen: «unmappable character for encoding UTF8», which is due to an inconsistency in encoding types. This can be seen on both Microsoft Windows and Linux, as well as in both the command line and client.

    [<code>]/build/RTC/snipped/StringUtils.java:[34,33] unmappable character for encoding UTF8

Resolving The Problem

To resolve this issue, follow the following steps to resolve the issue, depending on where you received the error message:

  1. When using the Client to preform a build:This is because the character encoding does not match what the client is configured to run using. This can be changed by going to the following section in the Rational Team Concert Client, Window > Preferences > General/Workspace page > Text file encoding section

  2. When using Command Line to preform a build:
    If this error is seen when running a build from the command prompt, try adding the following variables into the command:

    -encoding UTF8

    Example: Command line options:

    -d /build/RTC/wdp_bssview/target/classes -classpath … … -g -nowarn -target 1.6 -source 1.6 -encoding UTF8

  3. When interchanging between Windows and Linux Environments
    This error may also be seen if build files are being constantly exchanged between Windows and Linux Systems. Most Windows systems have en_US.ISO-8859-1 configured as the default encoding. Therefore, special characters don’t map from en_US.ISO-8859-1 to en_US.UTF-8 as expected when compiling. The default character encoding scheme of most Linux systems is en_US.UTF-8 as defined in /etc/sysconfig/i18n. Therefore, if you are coding in Windows, and try to run the build in Linux, you may receive the same error. To solve this, perform the above steps, as well as set the LANG environment variable to en_US.ISO-8859-1:

    export LANG=en_US.ISO-8859-1
    echo $LANG
    en_US.ISO-8859-1

Leverage the Jazz Community

Jazz and Rational Team Concert have an active community that can provide you with additional resources. Browse and contribute to the User forums, contribute to the Team Blog and review the Team wiki.
Refer to technote 1319600 for details and links.

[{«Product»:{«code»:»SSUC3U»,»label»:»IBM Engineering Workflow Management»},»Business Unit»:{«code»:»BU059″,»label»:»IBM Software w/o TPS»},»Component»:»Build»,»Platform»:[{«code»:»PF016″,»label»:»Linux»},{«code»:»PF033″,»label»:»Windows»}],»Version»:»1.0;1.0.1;1.0.1.1;2.0″,»Edition»:»»,»Line of Business»:{«code»:»LOB59″,»label»:»Sustainability Software»}}]

Historical Number

29019;004;000

Product Synonym

Rational Team Concert

I clone the repository and checkout master (currently the same as the ‘release_5.3.0’ tag).

When I run mvn install -e -X I get:

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T08:41:47-08:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_66, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.3", arch: "x86_64", family: "mac"
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG]   Imported: javax.enterprise.inject.* < plexus.core
[DEBUG]   Imported: javax.enterprise.util.* < plexus.core
[DEBUG]   Imported: javax.inject.* < plexus.core
[DEBUG]   Imported: org.apache.maven.* < plexus.core

(…I removed many intermediate lines…)

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.959 s
[INFO] Finished at: 2016-01-12T13:26:13-08:00
[INFO] Final Memory: 15M/437M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project esper: Compilation failure
[ERROR] /Groups/dev/src/github/espertechinc/esper/esper/src/main/java/com/espertech/esper/epl/approx/CountMinSketchStateHashes.java:[20,8] error: unmappable character for encoding UTF8
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project esper: Compilation failure
/Groups/dev/src/github/espertechinc/esper/esper/src/main/java/com/espertech/esper/epl/approx/CountMinSketchStateHashes.java:[20,8] error: unmappable character for encoding UTF8


    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
/Groups/dev/src/github/espertechinc/esper/esper/src/main/java/com/espertech/esper/epl/approx/CountMinSketchStateHashes.java:[20,8] error: unmappable character for encoding UTF8


    at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
    at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    ... 20 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

  • #1

Собственно, сабж. При рекомпиляции модификации миллион ошибок «error: unmappable character for encoding UTF-8». Я понимаю, что это из-за кодировки, но как исправить?

  • #2

ПКМ по Minecraft -> Properties -> Выбирай кодировку UTF-8.

  • #3

Все, спасибо :)

  • #4

А разве это не из-за комментариев на русском? У меня из-за этого ошибка была

  • #5

Vova_master написал(а):

А разве это не из-за комментариев на русском? У меня из-за этого ошибка была

Не-а, у меня ошибка на мой Lore показывала. Хотя, названия, нормально… :/

  • #6

Vova_master написал(а):

А разве это не из-за комментариев на русском? У меня из-за этого ошибка была

Из-за всего русского, ибо кодировка была не UTF-8.

  • #7

f1rSt1k написал(а):

Vova_master написал(а):

А разве это не из-за комментариев на русском? У меня из-за этого ошибка была

Из-за всего русского, ибо кодировка была не UTF-8.

Ну у меня комментарии на русском местами, проблем нет. Да и кодировка у меня Cp1251, чего уж там.

  • #8

Ага. А хотя, похоже, что ты не можешь скачать эклипс, в то время, как все им пользуются. Лишь редко NetBeans. Еще реже IntelliJ IDEA.

  • #10

На андроиде есть DroidEdit там все: от Java и PhP до C++

  • #11

Ну, накатай свой, с ошибками и со всем. А потом нам кинь, на тест:)

  • #12

Ага. Учитывая, что в андроиде java не такая, что на компе… и opengl там тоже нет
[merge_posts_bbcode]Добавлено: 07.04.2014 23:33:27[/merge_posts_bbcode]

Да и грамматика там другая. Ни package ни чего

  • #13

Не знаешь — молчи.
Java там такая же. Пара пакетов исключена и все. На ведре не JavaME, не путай.
И opengl там есть, я даже скажу: биндинг opengl es. Потому что сам пишу под него приложения.
[merge_posts_bbcode]Добавлено: 07.04.2014 22:54:37[/merge_posts_bbcode]

А AIDE — отличная среда, рукожоп — диагноз и никакая IDE его не исправит.
Ошибки там нормально подсвечиваются. Только вот отладки без рута не увидишь. Спасибо ОС Андроид.

  • #14

Теоретически, можно ли запилить майн под ведро? Только нормальный, как на компе.

  • #15

Читал, что были проблемы с размером сейвов, в ближайшее время покопаюсь там (не знаю какие финтифлюшки может выкинуть тамошняя ОСь), но по логике вещей — реализуемо. Просто у можангов скорее всего нет нормальных рабочих рук под Android, да и мало кому это надо.

  • #16

Это точно. Так как на андроиде очень тяжело играть в майн. Даже на лопате. Да и команда, занимающаяся разработкой mcpe маленькая(хотя Нотч сделал игру за две недели в одиночку..)

  • #17

MCPE хороший проект, вот если бы он развивался быстрее…

  • #18

Да.. ТАм в 0.9.0 обещают в бета версию перейти а еще бесконечные миры, как в пк и генерацию.

  • #19

Поскорее бы уже редстоун добавили.

  • #20

Дааа… руда есть. Факел есть. А толку — 0

Проблема:

В проекте используется jaxws-maven-plugin версии 2.1, генерирующий классы по WSDL. В WSDL и импортируемой в неё схеме есть русские буквы в аннотациях. При сборке проекта при компиляции возникают ошибки «unmappable character for encoding UTF-8» при попытке скомпилировать сгенерированные классы. ОС — Windows, кодировка исходников проекта — UTF-8.

Проект использует кодировку исходников UTF-8. wsimport генерирует исходники в cp1251 (в системной кодировке), причем они содержат русские символы в комментариях, пришедшие туда из аннотаций к XSD-схеме.

В отличие от wsimport`а версии 2.2, опции «encoding», позволяющей задать кодировку целевых файлов, нет. Нет такой опции и у используемого им xjc (эту опцию можно было бы передать ему через опцию -B<xjcoption> wsimport`а).

Как ни странно, помогла установка параметра xnocompile в false:

<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.1</version>
<!— … —>
<configuration>
<sourceDestDir>${project.build.directory}/generated-sources/jaxws-wsimport</sourceDestDir>
<xnocompile>false</xnocompile>
<verbose>true</verbose>
<extension>true</extension>
<catalog>${basedir}/src/jax-ws-catalog.xml</catalog>
</configuration>
</plugin>

Также xnocompile можно установить в false не в конфигурации всего плагина, а внутри конфигурации execution`а, эффект тот же:

<plugin>
<groupId>org.jvnet.jax-ws-commons</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.1</version>
<executions>
 <execution>
<goals>
 <goal>wsimport</goal>
</goals>
<configuration>
 <xnocompile>false</xnocompile>
 <!— … —>
</configuration>
<!— … —>
 </execution>
</executions>
<!— … —>
</plugin>

Генерируемые исходники все также в cp1251, но компиляция проходит. Есть идея, что это происходит потому, что сгенерированные файлы компилируются сразу wsimport`ом, и в этом случае компилятор не обращает внимание на кодировку файлов проекта (посколько о ней не знает), а читает исходники в системной кодировке, в какой они и действительно закодированы.

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Unlock device tool asus me302kl неизвестная ошибка при подключении к сети
  • Unlock act of war high treason ошибка windows 10