Android packaging: fatal error: UTF-16

i got one or 2 files .h , looks like one of them is UTF-16, but why there’s an error with that?
to fix it i’ve used VSCode - there’s an option to choose encoding.
but in fact those files was made by UE and edited with VS2015

Hey ,

Please review this [AnswerHub post][1] to see whether or not their resolution is the same as yours. Please provide the same screenshots and if the issue isn’t resolved from this post.

Thanks!

Android building failing within a few seconds - Mobile - Epic Developer Community Forums

i’ve changed encoding myself as i described, but the error is in UE, because UE generates UTF-16 files and cannot compile it, i don’t understand why not compiling UTF-16?

The auto-generated files are written in whatever encoding the original filename had. Is it possible that you had UTF-16 in the filename of the actual .h file? Without seeing the actual original .h files, we wouldn’t be able to give you more information.

Thank you!

alphabet.h

// Эта программа распространяется в целях образования, с использованием Unreal Engine 4.

#pragma once

#include "Engine.h"

the first comment was taken from project settings i guess,
if it was in UTF-16, maybe it was copied as is in this file too

Please upload the error output as a .txt file as your next reply. Please also include the Target rules too.

Target rules are found in a similar filepath:

  • UE4Editor - E:\Program Files\Epic
    Games\4.9\Engine\Source\UE4Editor.Target.cs

  • UE4Game - E:\Program Files\Epic
    Games\4.9\Engine\Source\UE4Game.Target.cs

  • YourProject -
    C:\Users\NAME\Documents\Unreal
    Projects\PROJECT\Source\PROJECT.Target.cs

  • C:\Users\NAME\Documents\Unreal
    Projects\PROJECT\Source\PROJECTEditor.Target.cs

Upload these, along with the error .

Thanks!

Hey,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you!

well, i’ve already solve this problem by converting file from utf-16 to utf-8
it’s not the solution, because if UE4 don’t support UTF-16 encoding for .h files this can be found somewhere in code.
i can propose to define all produced files encoding with some menu just add checkbox UTF-16 if it’s not checked, then generate everything in utf-8
i don’t have already i think

The auto-generated files are written in whatever encoding the original filename had. If you have UTF-16 in the filename, it would have caused the encoding to come out differently. The engine can encode in UTF-16, it just doesn’t necessary use that encoding which is why the errors are thrown up.

Thanks!