Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
HusseinMorsy opened this issue Apr 27, 2024 · 4 comments

Comments

@HusseinMorsy
Copy link

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
Copy link
Author

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
Copy link

Yes send me your code

@dushanstoryful
Copy link

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

@khustochka
Copy link

Seeing the same with Cyrillic in ARM64 Docker image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants