jgarber / redcloth

RedCloth is a Ruby library for converting Textile into HTML.
Other
441 stars 113 forks source link

RedCloth Fails to Render Non-ASCII Characters Correctly on arm64 Architecture #91

Open HusseinMorsy opened 4 months ago

HusseinMorsy commented 4 months ago

Introduction:

To accurately demonstrate and test the issue, I set up two virtual servers on Hetzner Cloud, each with a different architecture: one server utilizes an arm64 (Ampere) processor, and the other uses an Intel Xeon (x86_64) processor. This configuration ensures that the comparison and results of the RedCloth gem's behavior on different architectures are consistent and controlled.

Environment: Ubuntu 24.04 LTS - arm64 (Ampere) & x86_64 (Intel Xeon) on Hetzner Cloud

Issue: Non-ASCII characters are not rendering correctly on the arm64 architecture.

Steps to reproduce:

  1. Set up a fresh installation of Ubuntu 24.04 LTS.

  2. Install necessary packages and the RedCloth gem:

    apt-get update -qq
    apt-get install --no-install-recommends -y build-essential ruby-dev
    gem install RedCloth
    irb

    This installs Ruby 3.2.3 and RedCloth 4.3.4 and opens the Ruby interactive shell.

  3. Inside the Ruby interactive shell:

    require 'redcloth'
    puts RedCloth.new("Müller").to_html

Results:

Architecture Output
arm64 <p>M</p>
x86_64 <p>Müller</p>

Expected: Both architectures should render <p>Müller</p>. Actual: The arm64 architecture does not render non-ASCII characters correctly.

Would appreciate any insights or suggestions on how to address this issue.

HusseinMorsy commented 4 months ago

Workaround: If you build the gem yourself on arm64, then it works. For compiling the project, you need the Ragel package.

apt-get install ragel
GregThoma commented 3 months ago

Yes send me your code

dushanstoryful commented 3 weeks ago

Change your cloth from red to blue :) . Try gem 'bluecloth' image