# Special characters on android mode -- encoding problem

**URL:** <https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994>\
**Category:** Processing\
**Created:** [July 22, 2018, 11:18pm UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994 "2018-07-22T23:18:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiago](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@Tiago](https://discourse.processing.org/u/Tiago)\
**Post date:** [July 22, 2018, 11:18pm UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/1 "2018-07-22T23:18:51Z")

</div>

Hello all,

I’ve a problem with my sketch, everytime I have a text with special characters, with text() function or with println().  
It works well on JAVA but makes strange characters on android mode!  
[reportingProcessingBug|690x415](https://discourse.processing.org/uploads/short-url/4NnrMKbf9nMLswsfimS6VBRAr2C.png)

I’ve tried to reinstall processing and android several times, but the problem continues.

I’ve tried to change the font, but it’s the same…Could someone please help me? Am I doing something wrong?  
I think this bug started after processing’s update but I’m not sure about it…

Thanks in advance

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [July 22, 2018, 11:45pm UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/2 "2018-07-22T23:45:04Z")

</div>

You need to provide your code that demonstrates this bug. Don’t forget to provide details about your phone, target Android API, Processing version, Processing Android mode version.

I also suggest running examples code. In Android mode, run the UI sketch under the ketai examples.

Kf

---

<div class="post-metadata">

**Author:** ![mokalux](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@mokalux](https://discourse.processing.org/u/mokalux)\
**Post date:** [July 23, 2018, 12:08am UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/3 "2018-07-23T00:08:33Z")

</div>

hello Tiago,

I had the same issue trying to display french characters (e, è, à, … for example) on android. The only way that worked for me was to read the text from a csv file and using processing table.

Hope this helps. Peace.

PS: kfrajer processing does not handle special characters well ☹

---

<div class="post-metadata">

**Author:** ![Tiago](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@Tiago](https://discourse.processing.org/u/Tiago)\
**Post date:** [July 23, 2018, 3:27am UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/4 "2018-07-23T03:27:01Z")

</div>

Hello kfrajer,

Thanks for your answer, I’m new and it is my first post.  
I’ve tried to provide the code example I used, but I see that the image seems to not open, I’ll try again:

 ![reportingProcessingBug](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/1X/219d9dce3b9e2e1a939d73a9cbbc35ad9210d0de.png)

(import processing.vr.\*; \<\< don’t take care about this, it was just a test)

- my mobile phone is an Samsung S7 with the last version, I’ve tried with the emulator of processing, the problem is the same.
- my processing version is 3.3.7.
- processing android mode is 4.0.2

What’s interesting, is that the application was working fine, till yesterday, when I got a bug with processing was not launching and had to reinstall processing all over again.

---

<div class="post-metadata">

**Author:** ![Tiago](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@Tiago](https://discourse.processing.org/u/Tiago)\
**Post date:** [July 23, 2018, 3:31am UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/5 "2018-07-23T03:31:19Z")

</div>

Hello mokalux,  
,

Yes it help’s =), in the case i’m not able to correct this problem, I’ll use your method about the csv file.

Thanks a lot

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [July 23, 2018, 3:31am UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/6 "2018-07-23T03:31:55Z")

</div>

Maybe change PDE’s “Editor and Console Font”? 🤔  
Hit CTRL + Comma in order to access PDE’s “Preferences”. 🤓

---

<div class="post-metadata">

**Author:** ![Tiago](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@Tiago](https://discourse.processing.org/u/Tiago)\
**Post date:** [July 23, 2018, 3:39am UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/7 "2018-07-23T03:39:44Z")

</div>

Thanks GoToLoop,

I’ve tried just at the moment, but it doesn’t work  
 ![reportingProcessingBug2](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/1X/f313165c1c475ea22cc1c7e3ccf237ea30731fca.png)

---

<div class="post-metadata">

**Author:** ![Tiago](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@Tiago](https://discourse.processing.org/u/Tiago)\
**Post date:** [July 26, 2018, 9:29pm UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/8 "2018-07-26T21:29:37Z")

</div>

What I understand is that everything in my console is working on UTF-8 but the compiler of Android is working on ISO…is that possible?

And is it possible to change the compiler’s encoding?

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [July 27, 2018, 8:41am UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/9 "2018-07-27T08:41:17Z")

</div>

> [@Tiago](#):
>
> And is it possible to change the compiler’s encoding?

Possibly look at setting the `file.encoding` system property to `UTF-8`. Depending on how the compiler is launched, might be easier via the environment variable mentioned at [How to get and set default Character encoding or Charset in Java? Example](https://javarevisited.blogspot.com/2012/01/get-set-default-character-encoding.html)

---

<div class="post-metadata">

**Author:** ![Tiago](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@Tiago](https://discourse.processing.org/u/Tiago)\
**Post date:** [July 27, 2018, 5:17pm UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/10 "2018-07-27T17:17:24Z")

</div>

Thanks @neilcsmith, unfortunatly it didn’t resolve, the function seems to work on Java but not on Android. And even If I change on Java it still work but on Android it’s the same:  
 ![reportingProcessingBug4](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/1X/982577687662842892f00287a1c35cbfffebecdd.png)

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [July 27, 2018, 5:45pm UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/11 "2018-07-27T17:45:31Z")

</div>

@Tiago I may not have explained it very well. You need to set that for whatever is going to be running the compiler (not in your sketch). That’s why trying the environment variables might be a better way.

---

<div class="post-metadata">

**Author:** ![Tiago](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@Tiago](https://discourse.processing.org/u/Tiago)\
**Post date:** [July 29, 2018, 7:10pm UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/12 "2018-07-29T19:10:25Z")

</div>

@neilcsmith ohh ok… not sure if I know how to do it, but I’ll try and then give a feedback, thanks again 🙂

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [July 29, 2018, 7:51pm UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/13 "2018-07-29T19:51:15Z")

</div>

You’re on Windows 10? There’s a simple GUI editor in system settings somewhere. Probably try searching in the menu IIRC.

---

<div class="post-metadata">

**Author:** ![Tiago](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@Tiago](https://discourse.processing.org/u/Tiago)\
**Post date:** [July 29, 2018, 9:12pm UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/14 "2018-07-29T21:12:28Z")

</div>

@neilcsmith Yes I’m on Windows 10, I’m sorry but I really don’t have any idea how to do it. 🙄  
I’m not finding any gui editor 😕

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [July 29, 2018, 9:28pm UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/15 "2018-07-29T21:28:37Z")

</div>

If you hit the Windows key and type environment variables is there nothing listed? If not, sorry I’ll have to refer you to Google as I don’t have access to my Windows testing machine at the moment and can’t remember which section it’s in.

---

<div class="post-metadata">

**Author:** ![Tiago](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@Tiago](https://discourse.processing.org/u/Tiago)\
**Post date:** [July 29, 2018, 9:34pm UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/16 "2018-07-29T21:34:49Z")

</div>

Yes there is:

 ![reportingProcessingBug5](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/1X/9b81ed4e35aa1770ad35f31431a3e7f78b1ff617.png)

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [July 30, 2018, 8:04am UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/17 "2018-07-30T08:04:30Z")

</div>

Yes, that’s the one. Clicking on the bottom button should open up a table where you can add / modify environment variables. You want to add (I think) one with the key `JAVA_TOOL_OPTIONS` and the value `-Dfile.encoding=UTF-8` You might be better restarting after doing that too. Fingers crossed that might help - remove it if not.

---

<div class="post-metadata">

**Author:** ![Tiago](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@Tiago](https://discourse.processing.org/u/Tiago)\
**Post date:** [July 30, 2018, 8:29am UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/18 "2018-07-30T08:29:30Z")

</div>

i did but processing was not launching anymore:

 ![reportingProcessingBug6](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/1X/4db23c17394aebd91a0feb196c33437da7eaa7d4.png)

I’ve deleted the variable and it launches again

---

<div class="post-metadata">

**Author:** ![neilcsmith](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/neilcsmith/32/144_2.png) [@neilcsmith](https://discourse.processing.org/u/neilcsmith)\
**Post date:** [July 30, 2018, 9:03am UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/19 "2018-07-30T09:03:50Z")

</div>

Weird! Are you sure you’ve got the right values in there - can you screenshot your environment variables table?

Just tried it on my Windows test machine, with Processing 3.4, and it’s working fine and picks up the right value - testing with this one liner

```auto
print(System.getProperty("file.encoding"));

```

---

<div class="post-metadata">

**Author:** ![Tiago](https://avatars.discourse-cdn.com/v4/letter/t/f0a364/32.png) [@Tiago](https://discourse.processing.org/u/Tiago)\
**Post date:** [July 30, 2018, 9:07am UTC](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994/20 "2018-07-30T09:07:02Z")

</div>

@neilcsmith MY BAD, I had copy " Dfile.encoding=UTF-8" instead of “-Dfile.encoding=UTF-8”. I’ve just corrected and it works!!!

Thanks mate!!  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/1X/19ee6eecf9ae39a307c9f8691fde4ca9346487b2.png)

**Build folder: C:\Users\Tiago\AppData\Local\Temp\android5221860165493195587sketch**  
**:app:preBuild UP-TO-DATE**  
**:app:preDebugBuild**  
**:app:compileDebugAidl**  
**:app:compileDebugRenderscript**  
**:app:checkDebugManifest**  
**:app:generateDebugBuildConfig**  
**:app:prepareLintJar**  
**:app:generateDebugResValues**  
**:app:generateDebugResources**  
**:app:mergeDebugResources**  
**:app:createDebugCompatibleScreenManifests**  
**:app:processDebugManifest**  
**:app:splitsDiscoveryTaskDebug**  
**:app:processDebugResources**  
**:app:generateDebugSources**  
**:app:javaPreCompileDebug**  
**:app:compileDebugJavaWithJavacPicked up JAVA\_TOOL\_OPTIONS: -Dfile.encoding=UTF-8**

**:app:compileDebugNdk NO-SOURCE**  
**:app:compileDebugSources**  
**:app:mergeDebugShaders**  
**:app:compileDebugShaders**  
**:app:generateDebugAssets**  
**:app:mergeDebugAssets**  
**:app:extractTryWithResourcesSupportJarDebug**  
**:app:transformClassesWithStackFramesFixerForDebug**  
**:app:transformClassesWithDesugarForDebugPicked up JAVA\_TOOL\_OPTIONS: -Dfile.encoding=UTF-8**

**Picked up JAVA\_TOOL\_OPTIONS: -Dfile.encoding=UTF-8**

**Picked up JAVA\_TOOL\_OPTIONS: -Dfile.encoding=UTF-8**

**:app:transformClassesWithDexBuilderForDebug**  
**:app:transformDexArchiveWithExternalLibsDexMergerForDebug**  
**:app:transformDexArchiveWithDexMergerForDebug**  
**:app:mergeDebugJniLibFolders**  
**:app:transformNativeLibsWithMergeJniLibsForDebug**  
**:app:processDebugJavaRes NO-SOURCE**  
**:app:transformResourcesWithMergeJavaResForDebug**  
**:app:validateSigningDebug**  
**:app:packageDebug**  
**:app:assembleDebug**

**BUILD SUCCESSFUL in 42s**  
**28 actionable tasks: 28 executed**  
**élève**

Thanks all others aswell for the help!!

[Next page](https://discourse.processing.org/t/special-characters-on-android-mode-encoding-problem/1994.md?page=2)
