Convert UTF8 to UTF16 (Windows)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Convert UTF8 to UTF16 (Windows)

tonka tonka

Hey,

I have a little problem with files which has to be UTF 16 instead of UTF 8, f.e. Visual studios .rc files. They must be utf16 and git detect it as bin files.
So my question is: how do you handle these files?
My rc files has to be generated with configure_file, so my hope was that configure_file will read utf8 and write utf16 if I want, but that seems not possible.
Is there and other way in cake to convert to utf16?

Greetings
Tonka


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Convert UTF8 to UTF16 (Windows)

Nicholas Braden
Are you sure about this UTF16 requirement? I have many projects
ranging from Visual Studio 2008 to 2015 that use .rc files and all of
them are ANSI/UTF8.

On Mon, Aug 29, 2016 at 2:43 AM, tonka tonka <[hidden email]> wrote:

> Hey,
>
> I have a little problem with files which has to be UTF 16 instead of UTF 8,
> f.e. Visual studios .rc files. They must be utf16 and git detect it as bin
> files.
> So my question is: how do you handle these files?
> My rc files has to be generated with configure_file, so my hope was that
> configure_file will read utf8 and write utf16 if I want, but that seems not
> possible.
> Is there and other way in cake to convert to utf16?
>
> Greetings
> Tonka
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Convert UTF8 to UTF16 (Windows)

Wolf
In reply to this post by tonka tonka
On , tonka tonka wrote:
> I have a little problem with files which has to be UTF 16 instead of UTF 8,
> f.e. Visual studios .rc files. They must be utf16 and git detect it as bin
> files.
> So my question is: how do you handle these files?
> My rc files has to be generated with configure_file, so my hope was that
> configure_file will read utf8 and write utf16 if I want, but that seems not
> possible.
> Is there and other way in cake to convert to utf16?

I would just use iconv for this. Call it as external program to do the
conversion.

W.
--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Convert UTF8 to UTF16 (Windows)

tonka tonka
In reply to this post by Nicholas Braden

Nicholas, you are right. My mistake was that i've used utf8 with BOM, but visual studio only likes without BOM.

Thx


Am 29.08.2016 09:47 schrieb "Nicholas Braden" <[hidden email]>:
Are you sure about this UTF16 requirement? I have many projects
ranging from Visual Studio 2008 to 2015 that use .rc files and all of
them are ANSI/UTF8.

On Mon, Aug 29, 2016 at 2:43 AM, tonka tonka <[hidden email]> wrote:
> Hey,
>
> I have a little problem with files which has to be UTF 16 instead of UTF 8,
> f.e. Visual studios .rc files. They must be utf16 and git detect it as bin
> files.
> So my question is: how do you handle these files?
> My rc files has to be generated with configure_file, so my hope was that
> configure_file will read utf8 and write utf16 if I want, but that seems not
> possible.
> Is there and other way in cake to convert to utf16?
>
> Greetings
> Tonka
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake