Giter Club home page Giter Club logo

mofilereader's Introduction

mofilereader

This API lets you read .mo-Files and use their content just as you would do with GNUs gettext. It is implemented in C++ with a very liberal license, allowing the programmer to use it in modern programs, without the need of linking against gettext and libiconv.

You will need cmake to build it as a seperate application or library, or just include the few files into your project. Any C++ Compiler should suffice. This only fully supports utf-8, as I don't want this to be extensive.

Optionally, you can also build an executable that is able to dump any .mo file to .html to peek into the contents of this file.

Please report any issues you encounter, I can't fix them if I don't know about them!

mofilereader's People

Contributors

anotherfoxguy avatar domeniko-gentner avatar renovate-bot avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mofilereader's Issues

Error compiling MofileReader in Ubuntu 18.04 LTS

When I try to compile ROR with conan, everything goes smooth until it tries to build MofileReader, at which point the build fails. I have tried to compile MofileReader alone from the GitHub repository, which generated the same error message. Running the compilation with sudo made absolutely no difference. Since I seem to be the only one experiencing this issue, I assume that I'm doing something wrong or am missing a dependency. Unfortunately, I do not understand code very well, which is why I would appreciate any advice which might help me resolve this problem.

The console output is as follows:

Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=7
os=Linux
os_build=Linux
[options]
[build_requires]
[env]

WARN: libcurl/7.61.1@bincrafters/stable requirement OpenSSL/latest_1.0.2x@conan/stable overridden by your conanfile to OpenSSL/1.0.2n@conan/stable 
WARN: SocketW/3.10.36@anotherfoxguy/stable requirement OpenSSL/1.1.1b@conan/stable overridden by your conanfile to OpenSSL/1.0.2n@conan/stable 
AngelScript/2.32@anotherfoxguy/stable: WARN: Can't update, no package in remote
MofileReader/1.0.0@anotherfoxguy/stable: WARN: Package is corrupted, removing folder: /home/blossis/.conan/data/MofileReader/1.0.0/anotherfoxguy/stable/package/9bfdcfa2bb925892ecf42e2a018a3f3529826676
conanfile.txt: Installing package
Requirements
    AngelScript/2.32@anotherfoxguy/stable from 'ror-dependencies' - Cache
    MofileReader/1.0.0@anotherfoxguy/stable from 'ror-dependencies' - Cache
    MyGUI/3.2.3-OGRE-1.11.6@anotherfoxguy/stable from 'ror-dependencies' - Cache
    OGRE/1.11.6@anotherfoxguy/stable from 'ror-dependencies' - Cache
    OGREdeps/2018-07@anotherfoxguy/stable from 'ror-dependencies' - Cache
    OpenSSL/1.0.2n@conan/stable from 'conan-center' - Cache
    SocketW/3.10.36@anotherfoxguy/stable from 'ror-dependencies' - Cache
    libalsa/1.1.5@conan/stable from 'conan-center' - Cache
    libcurl/7.61.1@bincrafters/stable from 'conan-center' - Cache
    ogre-caelum/0.6.3@anotherfoxguy/stable from 'ror-dependencies' - Cache
    openal/1.19.0@bincrafters/stable from 'conan-center' - Cache
    rapidjson/1.1.0@bincrafters/stable from 'conan-center' - Cache
    zlib/1.2.11@conan/stable from 'conan-center' - Cache
Packages
    AngelScript/2.32@anotherfoxguy/stable:9bfdcfa2bb925892ecf42e2a018a3f3529826676 - Cache
    MofileReader/1.0.0@anotherfoxguy/stable:9bfdcfa2bb925892ecf42e2a018a3f3529826676 - Build
    MyGUI/3.2.3-OGRE-1.11.6@anotherfoxguy/stable:794abba7d4af0700133a17ba2c4dac59899b1f5e - Build
    OGRE/1.11.6@anotherfoxguy/stable:67aff274186b3a1145d3181322df68cc39c34a47 - Build
    OGREdeps/2018-07@anotherfoxguy/stable:9bfdcfa2bb925892ecf42e2a018a3f3529826676 - Build
    OpenSSL/1.0.2n@conan/stable:75b541b6f810787a4fcee8cec9cfdbf95959366f - Download
    SocketW/3.10.36@anotherfoxguy/stable:c4f9c455510be85e79a0cca0c8ebab83e1327e56 - Build
    libalsa/1.1.5@conan/stable:9bfdcfa2bb925892ecf42e2a018a3f3529826676 - Build
    libcurl/7.61.1@bincrafters/stable:ce65897ce836adb3eb34ee8ea84017665908a349 - Download
    ogre-caelum/0.6.3@anotherfoxguy/stable:d60ed3d41e77cedfd6528ad4c6a530913a3a92b6 - Build
    openal/1.19.0@bincrafters/stable:812e1deb664b70de9456fc54c225f826fbca36e7 - Download
    rapidjson/1.1.0@bincrafters/stable:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Download
    zlib/1.2.11@conan/stable:d50a0d523d98c15bb147b18fa7d203887c38be8b - Download

AngelScript/2.32@anotherfoxguy/stable: Already installed!
MofileReader/1.0.0@anotherfoxguy/stable: WARN: Build folder is dirty, removing it: /home/blossis/.conan/data/MofileReader/1.0.0/anotherfoxguy/stable/build/9bfdcfa2bb925892ecf42e2a018a3f3529826676
MofileReader/1.0.0@anotherfoxguy/stable: Copying sources to build folder
MofileReader/1.0.0@anotherfoxguy/stable: Building your package in /home/blossis/.conan/data/MofileReader/1.0.0/anotherfoxguy/stable/build/9bfdcfa2bb925892ecf42e2a018a3f3529826676
MofileReader/1.0.0@anotherfoxguy/stable: Generator txt created conanbuildinfo.txt
MofileReader/1.0.0@anotherfoxguy/stable: Calling build()
-- Found SWIG: /usr/bin/swig3.0 (found suitable version "3.0.12", minimum required is "3.0.8") 
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_EXPORT_NO_PACKAGE_REGISTRY
    CMAKE_INSTALL_BINDIR
    CMAKE_INSTALL_DATAROOTDIR
    CMAKE_INSTALL_INCLUDEDIR
    CMAKE_INSTALL_LIBDIR
    CMAKE_INSTALL_LIBEXECDIR
    CMAKE_INSTALL_OLDINCLUDEDIR
    CMAKE_INSTALL_SBINDIR
    CONAN_COMPILER
    CONAN_COMPILER_VERSION
    CONAN_CXX_FLAGS
    CONAN_C_FLAGS
    CONAN_EXPORTED
    CONAN_IN_LOCAL_CACHE
    CONAN_LIBCXX
    CONAN_SHARED_LINKER_FLAGS


-- Build files have been written to: /home/blossis/.conan/data/MofileReader/1.0.0/anotherfoxguy/stable/build/9bfdcfa2bb925892ecf42e2a018a3f3529826676
Scanning dependencies of target moFileReader
[ 12%] Building CXX object CMakeFiles/moFileReader.dir/src/mo.cpp.o
[ 25%] Building CXX object CMakeFiles/moFileReader.dir/src/moFileReader.cpp.o
[ 37%] Linking CXX static library libmoFileReader.a
[ 37%] Built target moFileReader
Scanning dependencies of target moReader
[ 50%] Swig source
[ 62%] Building CXX object CMakeFiles/moReader.dir/src/mo.cpp.o
Scanning dependencies of target libMoFileReader
[ 75%] Building CXX object CMakeFiles/libMoFileReader.dir/tools/moFileCSharpLib/moFileReaderCSHARP_wrap.cxx.o
[ 87%] Linking CXX executable moReader
[ 87%] Built target moReader
[100%] Linking CXX shared module tools/moFileCSharpLib/libMoFileReader.so
/usr/bin/ld: libmoFileReader.a(moFileReader.cpp.o): relocation R_X86_64_PC32 against symbol `_ZN9moFileLib12moFileReader15MakeHtmlConformERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
CMakeFiles/libMoFileReader.dir/build.make:101: recipe for target 'tools/moFileCSharpLib/libMoFileReader.so' failed
make[2]: *** [tools/moFileCSharpLib/libMoFileReader.so] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/libMoFileReader.dir/all' failed
make[1]: *** [CMakeFiles/libMoFileReader.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2
MofileReader/1.0.0@anotherfoxguy/stable: 
MofileReader/1.0.0@anotherfoxguy/stable: ERROR: Package '9bfdcfa2bb925892ecf42e2a018a3f3529826676' build failed
MofileReader/1.0.0@anotherfoxguy/stable: WARN: Build folder /home/blossis/.conan/data/MofileReader/1.0.0/anotherfoxguy/stable/build/9bfdcfa2bb925892ecf42e2a018a3f3529826676
ERROR: MofileReader/1.0.0@anotherfoxguy/stable: Error in build() method, line 17
	cmake.build()
	ConanException: Error 512 while executing cmake --build '/home/blossis/.conan/data/MofileReader/1.0.0/anotherfoxguy/stable/build/9bfdcfa2bb925892ecf42e2a018a3f3529826676' '--' '-j4'
blossis@Blockwood:~/builds/rigs-of-rods$ 

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

conan
conanfile.txt
  • catch2 3.6.0
github-actions
.github/workflows/main.yml
  • actions/github-script v7
  • actions/checkout v4
  • actions/cache v4
  • ilammy/msvc-dev-cmd v1
  • actions/checkout v4
  • actions/cache v4
  • actions/checkout v4
  • actions/cache v4
.github/workflows/sonarcloud.yml
  • actions/checkout v4
  • sonarsource/sonarcloud-github-c-cpp v2
  • actions/cache v4
  • actions/cache v4

Check if the file being read is a valid .mo file

Currently, when you try to load an invalid .mo file (such as a .po file) the mofile will start hogging memory and lock up.
mofile should check if the file that is being loaded is a valid .mo file before starting reading it.

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.