Code Monkey home page Code Monkey logo

Comments (6)

Jehan avatar Jehan commented on July 21, 2024

First, I just want to remind that this repository is deprecated. As explained at the top of the README, uchardet moved to Freedesktop: https://www.freedesktop.org/wiki/Software/uchardet/
I'll still answer but if you have further issues, I would prefer you ask them in our dedicated bug tracker on Freedesktop: https://bugs.freedesktop.org/enter_bug.cgi?product=uchardet
Some day, maybe I will stop answering on the current github repo. ;P

Can this code be used to make a Windows DLL?

Yes very easily! I just made a DLL for Windows, for the sake of testing, it took me exactly 5 seconds (I really timed it! This is no random number!) from scratch to make a usable Windows DLL. :-)

If yes please could you guide me how?

I am not sure what are the difference on Windows (I cross-compile for Windows from a Linux machine), but this should just work the same as any CMake project.
In linux, you would just run CMake like this:

cd /path/to/uchardet/source/
mkdir build
cd build
cmake ..
make

And you are done. Since the code is very small (yet very useful and efficient! ;p), that takes just a few seconds of compilation.
You'll find a file named libuchardet.dll under src/ subdirectory of build/.
I assume that works the same in Windows. I also know that several build platforms on Windows have support for CMake (therefore you can embed the build of CMake inside a bigger project).

I have some hope because looking in CMakeLists.txt file there is a option for win32 (# although commented #)

This code is old, useless and wrong. I got rid of it just now: https://cgit.freedesktop.org/uchardet/uchardet/commit/?id=df67ae4fe0db0f3da3698e2002cb90e52eb65a4d
Also it changes nothing for compiling for win32 which works just fine without it, as I said. :-)

Compiler name and version you know this can be compiled (in windows of course)

It works just fine with gcc, and I guess it would work well with LLVM as well. Actually I'm guessing it should compile fine with just any C and C++ (there are both C and C++ code in uchardet) compilers because the code does not use any specificity or very advanced syntax AFAIK (though that's untested and I welcome patches if you find compiler-specific code which prevents the code to be compiled with other compilers).

Basic procedure (or at least some hints)

Cf. above.

With the right compiler and procedure can be done or is need some modification of the code?

No code modification is necessary. If you need to change anything to be able to compile, there is a problem either in your build procedure or in our code/build files (if this is the latter, we welcome patches, once again). Also as I said, I just compiled right now a Win32 DLL (though in a cross-compilation environment) so chances are high it will work just as well in a native environment without needing to tweak anything (and I tell it a third time because that's important: if you ended up needing to tweak, tell us what, so we can fix the code to make it as generic as possible!).

PD: I know what exist a version of Mozilla code for Windows made in Delphi here but yours seems more complete and detect much more encodes.

Note that this code is not maintained by Mozilla anymore (for quite some time now!) and that we improved it quite a lot since that time (i.e. indeed a lot more encoding, but also existing encoding detection has been improved a lot, etc.).

uchardet is actively maintained, and new feature development happens too (at slow pace, but it is done). So I don't know the development pace of other libraries which started from the same base code as us (most of them seem abandoned, but I can't say I really track what they do so I may be wrong), but I can say at least that our repo on freedesktop is a good choice at least. ;-)

I wish you good end-of-year holidays! :-)

from uchardet.

antekgla avatar antekgla commented on July 21, 2024

Thanks for your kind answer!
I open an account in bugzilla for write you there too...

I would try to make this compile in my windows machine for give you feedback....
but this world of GCC, Make, CMake are completly new for me and I dont know if I would be succesfully πŸ˜•
In the meantime if this is not too much abuse of your generosity:
Could you share with me this 32bit binary DLL you make in your linux machine?

If you dont want to share binaries, I completly understand ...

Thanks and Merry Christmas for you too! πŸŽ… πŸŽ„

from uchardet.

antekgla avatar antekgla commented on July 21, 2024

Well, for future references if anyone want to build this in Windows, this is how I did:

  • Download & Install CMake for Windows.
  • Download & Install MinGW for Windows.
  • Make sure what CMake\bin & MingGW\bin are in your PATH (important!!).
  • Download uchardet source code and unzip.
  • Open a cmd window and change to folder where you unzip uchardet source code.
  • Type this commands:
mkdir build
cd build
cmake .. -G "MinGW Makefiles"
mingw32-make
  • Done!
    in the folder \build\src you have libuchardet.dll
    in the folder \build\src\tools you have uchardet.exe

Thanks @Jehan

from uchardet.

Jehan avatar Jehan commented on July 21, 2024

Hi @antekgla,
Sorry was not available yesterday.

In the meantime if this is not too much abuse of your generosity:
Could you share with me this 32bit binary DLL you make in your linux machine?

So I assume this is not needed anymore? :-)
That's great. Better for you to be fully independant and to know how to build a CMake project. ;-)

from uchardet.

antekgla avatar antekgla commented on July 21, 2024

Sorry was not available yesterday.

There is not need to apologize. Only nerds like me do this things in a date like Yesterday πŸŽ…

So I assume this is not needed anymore? :-)

No. Miraculously I could compile myself... πŸ˜„ in part thanks to this page. Although I use MinGW 32 and not 64.

That's great. Better for you to be fully independant and to know how to build a CMake project. ;-)

Yes! Better knows how to make this things by myself, so in case of new version I can compile again and dont bother you.

If you accept a suggestion, can you put the instructions for compile in windows in your freedesktop page ?, for other windows users like me, ignorant in this matters of cmake & minGW.

Thanks!
...and Happy New Year πŸŽ‰

from uchardet.

Jehan avatar Jehan commented on July 21, 2024

Done in the README. I'll update the web page later as well. Thanks.

from uchardet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.