Localization: add C++ converters for UTF8 & Wide strings 50/17250/2
Calixte DENIZET [Thu, 24 Sep 2015 09:56:00 +0000 (11:56 +0200)]
Change-Id: I38f3605afb2fc08062aa6ec9520be90f00d3dd3b

scilab/modules/localization/Makefile.am
scilab/modules/localization/Makefile.in
scilab/modules/localization/includes/UTF8.hxx [new file with mode: 0644]
scilab/modules/localization/includes/localization.hxx
scilab/modules/localization/src/cpp/UTF8.cpp [new file with mode: 0644]
scilab/modules/localization/src/cpp/localization.cpp
scilab/modules/localization/src/localization.vcxproj
scilab/modules/localization/src/localization.vcxproj.filters

index 4a85989..de1f198 100644 (file)
@@ -28,7 +28,8 @@ LOCALIZATION_C_SOURCES += \
 endif
 
 LOCALIZATION_CPP_SOURCES = \
-    src/cpp/localization.cpp
+    src/cpp/localization.cpp \
+    src/cpp/UTF8.cpp
 
 GATEWAY_C_SOURCES = \
     sci_gateway/c/sci_addlocalizationdomain.c \
index a45ea9e..d4d2914 100644 (file)
@@ -196,7 +196,8 @@ am__libscilocalization_algo_la_SOURCES_DIST =  \
        src/c/getLcidString.c src/c/charEncoding.c \
        src/c/setdefaultlanguage.c src/jni/Messages_wrap.c \
        src/jni/LocaleToLCID_wrap.c src/jni/setdefaultlanguage_wrap.c \
-       src/c/getLocaleInfo_Apple.c src/cpp/localization.cpp
+       src/c/getLocaleInfo_Apple.c src/cpp/localization.cpp \
+       src/cpp/UTF8.cpp
 am__dirstamp = $(am__leading_dot)dirstamp
 @NEED_JAVA_TRUE@am__objects_1 = src/jni/libscilocalization_algo_la-Messages_wrap.lo \
 @NEED_JAVA_TRUE@       src/jni/libscilocalization_algo_la-LocaleToLCID_wrap.lo \
@@ -209,7 +210,8 @@ am__objects_3 =  \
        src/c/libscilocalization_algo_la-charEncoding.lo \
        src/c/libscilocalization_algo_la-setdefaultlanguage.lo \
        $(am__objects_1) $(am__objects_2)
-am__objects_4 = src/cpp/libscilocalization_algo_la-localization.lo
+am__objects_4 = src/cpp/libscilocalization_algo_la-localization.lo \
+       src/cpp/libscilocalization_algo_la-UTF8.lo
 am_libscilocalization_algo_la_OBJECTS = $(am__objects_3) \
        $(am__objects_4)
 libscilocalization_algo_la_OBJECTS =  \
@@ -598,6 +600,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 srcdir = @srcdir@
@@ -612,7 +615,8 @@ LOCALIZATION_C_SOURCES = src/c/InitializeLocalization.c \
        src/c/charEncoding.c src/c/setdefaultlanguage.c \
        $(am__append_1) $(am__append_2)
 LOCALIZATION_CPP_SOURCES = \
-    src/cpp/localization.cpp
+    src/cpp/localization.cpp \
+    src/cpp/UTF8.cpp
 
 GATEWAY_C_SOURCES = \
     sci_gateway/c/sci_addlocalizationdomain.c \
@@ -883,6 +887,8 @@ src/cpp/$(DEPDIR)/$(am__dirstamp):
        @: > src/cpp/$(DEPDIR)/$(am__dirstamp)
 src/cpp/libscilocalization_algo_la-localization.lo:  \
        src/cpp/$(am__dirstamp) src/cpp/$(DEPDIR)/$(am__dirstamp)
+src/cpp/libscilocalization_algo_la-UTF8.lo: src/cpp/$(am__dirstamp) \
+       src/cpp/$(DEPDIR)/$(am__dirstamp)
 
 libscilocalization-algo.la: $(libscilocalization_algo_la_OBJECTS) $(libscilocalization_algo_la_DEPENDENCIES) $(EXTRA_libscilocalization_algo_la_DEPENDENCIES) 
        $(AM_V_CXXLD)$(CXXLINK)  $(libscilocalization_algo_la_OBJECTS) $(libscilocalization_algo_la_LIBADD) $(LIBS)
@@ -952,6 +958,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscilocalization_algo_la-getLocaleInfo_Apple.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscilocalization_algo_la-setdefaultlanguage.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libscilocalization_algo_la-setgetlanguage.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscilocalization_algo_la-UTF8.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libscilocalization_algo_la-localization.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/jni/$(DEPDIR)/libscilocalization_algo_la-LocaleToLCID_wrap.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/jni/$(DEPDIR)/libscilocalization_algo_la-Messages_wrap.Plo@am__quote@
@@ -1089,6 +1096,13 @@ src/cpp/libscilocalization_algo_la-localization.lo: src/cpp/localization.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilocalization_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libscilocalization_algo_la-localization.lo `test -f 'src/cpp/localization.cpp' || echo '$(srcdir)/'`src/cpp/localization.cpp
 
+src/cpp/libscilocalization_algo_la-UTF8.lo: src/cpp/UTF8.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilocalization_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libscilocalization_algo_la-UTF8.lo -MD -MP -MF src/cpp/$(DEPDIR)/libscilocalization_algo_la-UTF8.Tpo -c -o src/cpp/libscilocalization_algo_la-UTF8.lo `test -f 'src/cpp/UTF8.cpp' || echo '$(srcdir)/'`src/cpp/UTF8.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libscilocalization_algo_la-UTF8.Tpo src/cpp/$(DEPDIR)/libscilocalization_algo_la-UTF8.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/UTF8.cpp' object='src/cpp/libscilocalization_algo_la-UTF8.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilocalization_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libscilocalization_algo_la-UTF8.lo `test -f 'src/cpp/UTF8.cpp' || echo '$(srcdir)/'`src/cpp/UTF8.cpp
+
 sci_gateway/cpp/libscilocalization_la-localization_gw.lo: sci_gateway/cpp/localization_gw.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscilocalization_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscilocalization_la-localization_gw.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscilocalization_la-localization_gw.Tpo -c -o sci_gateway/cpp/libscilocalization_la-localization_gw.lo `test -f 'sci_gateway/cpp/localization_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/localization_gw.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscilocalization_la-localization_gw.Tpo sci_gateway/cpp/$(DEPDIR)/libscilocalization_la-localization_gw.Plo
diff --git a/scilab/modules/localization/includes/UTF8.hxx b/scilab/modules/localization/includes/UTF8.hxx
new file mode 100644 (file)
index 0000000..6b1df8c
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2015 - Scilab Enterprises - Calixte DENIZET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include <string>
+
+#include "dynlib_localization.h"
+
+namespace scilab
+{
+
+class UTF8
+{
+
+public:
+
+    LOCALIZATION_IMPEXP static std::string toUTF8(const std::wstring & wstr);
+    LOCALIZATION_IMPEXP static std::wstring toWide(const std::string & str);
+
+private:
+
+    static int ReadUTF8Character(const char * str, int * nBytes);
+    static bool IsValidUTF8(const char*  pStText);
+
+};
+
+}
index 0e2862f..79fbd74 100644 (file)
@@ -18,9 +18,6 @@
 extern "C"
 {
 #include "dynlib_localization.h"
-#include "charEncoding.h"
-#include "localization.h"
-#include "sci_malloc.h"
 }
 
 #define _W(String)  gettextW(_(String))
diff --git a/scilab/modules/localization/src/cpp/UTF8.cpp b/scilab/modules/localization/src/cpp/UTF8.cpp
new file mode 100644 (file)
index 0000000..00d3d0d
--- /dev/null
@@ -0,0 +1,301 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - Yung-Jang Lee
+ * Copyright (C) 2009 - DIGITEO - Antoine ELIAS , Allan CORNET
+ * Copyright (C) 2015 - Scilab Enterprises - Calixte DENIZET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#ifndef _MSC_VER
+#include <iconv.h>
+#include <errno.h>
+#endif
+
+#include <cstdlib>
+
+#include "UTF8.hxx"
+
+#ifdef _MSC_VER
+#include <Windows.h>
+#endif
+
+namespace scilab
+{
+
+#ifdef _MSC_VER // Windows
+
+std::string UTF8::toUTF8(const std::wstring & wstr)
+{
+    char * buf = nullptr;
+    DWORD dwFlags = 0;
+    DWORD size = 0;
+
+    if (wstr.empty())
+    {
+        return std::string();
+    }
+
+    size = WideCharToMultiByte(CP_UTF8, dwFlags, wstr.c_str(), -1, nullptr, 0, nullptr, 0);
+    if (size == 0)
+    {
+        return std::string();
+    }
+
+    buf = new char[size];
+    size = WideCharToMultiByte(CP_UTF8, dwFlags, wstr.c_str(), -1, buf, size, nullptr, 0);
+    if (size <= 0)
+    {
+        delete[] buf;
+        return std::string();
+    }
+
+    std::string str(buf, buf + size);
+    delete[] buf;
+
+    return str;
+}
+
+std::wstring UTF8::toWide(const std::string & str)
+{
+    wchar_t *_buf = NULL;
+    DWORD dwFlags = 0;
+    UINT codePage = CP_ACP;
+
+    if (str.empty())
+    {
+        return std::wstring();
+    }
+
+    if (IsValidUTF8(str.c_str()))
+    {
+        codePage = CP_UTF8;
+    }
+
+    int nwide = MultiByteToWideChar(codePage, dwFlags, str.c_str(), -1, nullptr, 0);
+    if (nwide == 0)
+    {
+        return std::wstring();
+    }
+
+    wchar_t * buf = new wchar_t[nwide];
+    if (MultiByteToWideChar(codePage, dwFlags, str.c_str(), -1, buf, nwide) == 0)
+    {
+        delete[] buf;
+        return std::wstring();
+    }
+
+    std::wstring wstr(buf, buf + nwide);
+    delete[] buf;
+
+    return wstr;
+}
+
+#else
+#ifdef __APPLE__ // Mac OS_X
+
+std::string UTF8::toUTF8(const std::wstring & wstr)
+{
+    size_t iCharLen = 0;
+    wchar_t *pwstr = _wide;
+    char* pchar = NULL;
+
+    if (wstr.empty())
+    {
+        return std::string();
+    }
+
+    const int iMaxLen = (int)wstr.size() * MB_CUR_MAX ;
+
+    char * pchar = new char[iMaxLen];
+    size_t iCharLen = wcstombs(pchar, wstr.c_str(), iMaxLen);
+    if (iCharLen == (size_t)(-1) )
+    {
+        delete[] pchar;
+        return std::string();
+    }
+
+    std::string str(pchar, pchar + iMaxLen);
+    delete[] pchar;
+
+    return str;
+}
+
+std::wstring UTF8::toWide(const std::string & str)
+{
+    wchar_t *_buf = NULL;
+
+    if (str.empty())
+    {
+        return std::wstring();
+    }
+
+    mbstate_t ps;
+    memset (&ps, 0x00, sizeof(ps));
+
+    const char * psz = str.c_str();
+    size_t pszLen = mbsrtowcs(nullptr, &psz, 0, &ps);
+
+    if (pszLen == (size_t)(-1))
+    {
+        return std::wstring();
+    }
+
+    wchar_t * buf = new wchar_t[pszLen];
+    pszLen = mbsrtowcs(buf, &psz, str.size(), &ps);
+    if (pszLen == (size_t)(-1))
+    {
+        delete[] buf;
+        return std::wstring();
+    }
+
+    std::wstring wstr(buf, buf + pszLen);
+    delete[] buf;
+
+    return wstr;
+}
+
+#else // Linux
+
+std::string UTF8::toUTF8(const std::wstring & wstr)
+{
+    if (wstr.empty())
+    {
+        return std::string();
+    }
+
+    char * pIn = (char *)wstr.c_str();
+    size_t iLeftIn = wstr.size() * sizeof(wchar_t);
+    size_t iLeftOut = iLeftIn + sizeof(wchar_t);
+    char * pOut = new char[iLeftOut];
+    char * pOutSave = pOut;
+    iconv_t cd = iconv_open("UTF-8", "WCHAR_T");
+
+    size_t iSize = iconv(cd, &pIn, &iLeftIn, &pOut, &iLeftOut);
+    iconv_close(cd);
+    if (iSize == (size_t)(-1))
+    {
+        delete[] pOutSave;
+        return std::string();
+    }
+
+    std::string str(pOutSave, pOut);
+    delete[] pOutSave;
+
+    return str;
+}
+
+std::wstring UTF8::toWide(const std::string & str)
+{
+    if (str.empty())
+    {
+        return std::wstring();
+    }
+
+    char * pIn = (char *)str.c_str();
+    size_t iLeftIn = str.size();
+    size_t iLeftOut = (iLeftIn + 1) * sizeof(wchar_t);
+    wchar_t * pOut = new wchar_t[iLeftOut];
+    wchar_t * pOutSave = pOut;
+    iconv_t cd = iconv_open("WCHAR_T", "UTF-8");
+
+    size_t iSize = iconv(cd, &pIn, &iLeftIn, (char **)&pOut, &iLeftOut);
+    iconv_close(cd);
+    if (iSize == (size_t)(-1))
+    {
+        cd = iconv_open("WCHAR_T", "ISO_8859-1");
+        pIn = (char *)str.c_str();
+        iLeftIn = str.size();
+        iLeftOut = (iLeftIn + 1) * sizeof(wchar_t);
+        pOut = pOutSave;
+
+        iSize = iconv(cd, &pIn, &iLeftIn, (char **)&pOut, &iLeftOut);
+        iconv_close(cd);
+        if (iSize == (size_t)(-1))
+        {
+            return std::wstring();
+        }
+    }
+
+    std::wstring wstr(pOutSave, pOut);
+    delete[] pOutSave;
+
+    return wstr;
+}
+
+#endif
+#endif
+
+int UTF8::ReadUTF8Character(const char * str, int * nBytes)
+{
+    const unsigned char* s = (const unsigned char*)(str);
+    unsigned char c = s[0];
+
+    if (c < 0x80)
+    {
+        *nBytes = 1;
+        return c;
+    }
+    else if (c < 0xC2)
+    {
+        return -1;
+    }
+    else if (c < 0xE0)
+    {
+        if (s[1] == 0 || (s[1] ^ 0x80) >= 0x40)
+        {
+            return -1;
+        }
+        *nBytes = 2;
+        return ((s[0] & 0x1F) << 6) + (s[1] ^ 0x80);
+    }
+    else if (c < 0xF0)
+    {
+        if (s[1] == 0 || s[2] == 0 || (s[1] ^ 0x80) >= 0x40
+                || (s[2] ^ 0x80) >= 0x40 || (c == 0xE0 && s[1] < 0xA0))
+        {
+            return -1;
+        }
+        *nBytes = 3;
+        return ((s[0] & 0xF) << 12) + ((s[1] ^ 0x80) << 6) + (s[2] ^ 0x80);
+    }
+    else if (c < 0xF5)
+    {
+        if (s[1] == 0 || s[2] == 0 || s[3] == 0 || (s[1] ^ 0x80) >= 0x40
+                || (s[2] ^ 0x80) >= 0x40 || (s[3] ^ 0x80) >= 0x40
+                || (c == 0xF0 && s[1] < 0x90) || (c == 0xF4 && s[1] > 0x8F))
+        {
+            return -1;
+        }
+        *nBytes = 4;
+        return ((s[0] & 0x07) << 18) + ((s[1] ^ 0x80) << 12) + ((s[2] ^ 0x80) << 6)
+               + (s[3] ^ 0x80);
+    }
+    else
+    {
+        return -1;
+    }
+}
+
+bool UTF8::IsValidUTF8(const char*  pStText)
+{
+    const char* s = pStText;
+    while (*s != 0)
+    {
+        int nBytes = 0;
+        if (ReadUTF8Character(s, &nBytes) < 0)
+        {
+            return false;
+        }
+        s += nBytes;
+    }
+
+    return true;
+}
+
+} // namespace scilab
index 57b4be3..fae87c6 100644 (file)
 
 #include "localization.hxx"
 
+extern "C"
+{
+#include "charEncoding.h"
+#include "sci_malloc.h"
+}
+
 std::wstring gettextW(const char* s)
 {
     wchar_t* pwst = to_wide_string(s);
index a2e7acc..686e974 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -237,6 +237,7 @@ lib /DEF:"$(ProjectDir)ast_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="cpp\localization.cpp" />
+    <ClCompile Include="cpp\UTF8.cpp" />
     <ClCompile Include="c\charEncoding.c" />
     <ClCompile Include="c\DllmainLocalization.c" />
     <ClCompile Include="c\getLcidString.c" />
@@ -262,16 +263,16 @@ lib /DEF:"$(ProjectDir)ast_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /
   <ItemGroup>
     <ClInclude Include="..\includes\charEncoding.h" />
     <ClInclude Include="..\includes\defaultlanguage.h" />
-    <ClInclude Include="..\includes\dynlib_localization_gw.h" />
+    <ClInclude Include="..\includes\dynlib_localization.h" />
     <ClInclude Include="..\includes\gw_localization.h" />
     <ClInclude Include="..\includes\InitializeLocalization.h" />
     <ClInclude Include="..\includes\LanguagePreferences_Windows.h" />
     <ClInclude Include="..\includes\localization.h" />
     <ClInclude Include="..\includes\localization.hxx" />
     <ClInclude Include="..\includes\localizationJava.h" />
-    <ClInclude Include="..\includes\localization_gw.hxx" />
     <ClInclude Include="..\includes\setgetlanguage.h" />
     <ClInclude Include="..\includes\TerminateLocalization.h" />
+    <ClInclude Include="..\includes\UTF8.hxx" />
     <ClInclude Include="c\getentrieshashtable.h" />
     <ClInclude Include="c\getLcidString.h" />
     <ClInclude Include="c\getLocaleInfo_Apple.h" />
index 171e257..331773e 100644 (file)
@@ -88,6 +88,9 @@
     <ClCompile Include="cpp\localization.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="cpp\UTF8.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\includes\charEncoding.h">
@@ -96,9 +99,6 @@
     <ClInclude Include="..\includes\defaultlanguage.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\includes\dynlib_localization_gw.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\includes\gw_localization.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="..\includes\localization.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\includes\localization_gw.hxx">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\includes\localizationJava.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="..\includes\localization.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\includes\UTF8.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\includes\dynlib_localization.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
 </Project>
\ No newline at end of file