Giter Site home page Giter Site logo

Comments (32)

kazarmy avatar kazarmy commented on May 29, 2024 1

Try looking at the r2r bins bins/pe/testapp-msvc64.exe, bins/elf/strenc and bins/elf/strenc-guess-utf32le. They don't cover all the things posted though and could be more comprehensive.

The test binaries were produced using string literals (C / C++).

Btw, there are some UTF utility functions in libr/util/utf8.c / utf16.c / utf32.c. Better not to have duplicate code.

I see you did:

  • Support for fullwidth characters in graph mode

Thanks!

from ideas.

kazarmy avatar kazarmy commented on May 29, 2024 1

Actually at least for Arabic, shaping is not that complex. Remember that in real life shaping has to be done manually by kids.

from ideas.

XVilka avatar XVilka commented on May 29, 2024

For the RTL part - it supports Arabic filenames and comments but fails only in direction:
ar

from ideas.

schrotthaufen avatar schrotthaufen commented on May 29, 2024
#include <stdio.h>

int main(void) {
        printf("ÄÖæxßf®\n");
        return 0;
}

Actual result:
[0x00400410]> fs strings
[0x00400410]> f
0x004005a4 13 str.____x__f

Expected result:
[0x00400410]> fs strings
[0x00400410]> f
0x004005a4 13 str.ÄÖæxßf®\n

from ideas.

radare avatar radare commented on May 29, 2024

flags cant contain strange chars, and by strange i mean non-7bit-ascii

thats how the r_name_filter() works

not going to fix/change this before the release. flags needs to be rewritten to use sdb

On 16 Apr 2015, at 17:52, schrotthaufen [email protected] wrote:

#include <stdio.h>

int main(void) {
printf("ÄÖæxßf®\n");
return 0;
}
Actual result:
[0x00400410]> fs strings
[0x00400410]> f
0x004005a4 13 str.____x__f

Expected result:
[0x00400410]> fs strings
[0x00400410]> f
0x004005a4 13 str.ÄÖæxßf®\n


Reply to this email directly or view it on GitHub https://github.com/radare/radare2/issues/2032#issuecomment-93769332.

from ideas.

XVilka avatar XVilka commented on May 29, 2024

@radare updated the bug, thanks!

from ideas.

XVilka avatar XVilka commented on May 29, 2024

Btw, Arabic comments are working in the mlterm:

from ideas.

holdsworth avatar holdsworth commented on May 29, 2024

In Hebrew, using XTERM terminal - the comments are being represented, however they are written the other around as a problem in XTERM in general that the first character is in the left and the next one is afterwards, ltr instead of rtl(reverts the text).

Example given:

  1. proper:
    זאת הערה
  2. how it is actually represented:
    הרעה תאז

As written in xterm/README(https://github.com/joejulian/xterm/blob/master/README.i18n) 👍
"Xterm does not support bi-directional or RTL languages such as Hebrew
and Arab."

From a little bit of research I am taking a look into another console which might offer the support for rtl languages and it will be more correct to operate r2 under that console

from ideas.

XVilka avatar XVilka commented on May 29, 2024

@holdsworth try mlterm

from ideas.

holdsworth avatar holdsworth commented on May 29, 2024

@XVilka mlterm doesn't represent Hebrew at all, with Konsole it works perfectly fine for some reason.

from ideas.

radare avatar radare commented on May 29, 2024

please update the checkboxes

from ideas.

holdsworth avatar holdsworth commented on May 29, 2024

please be more precise

from ideas.

radare avatar radare commented on May 29, 2024

cc @kazarmy

from ideas.

Maijin avatar Maijin commented on May 29, 2024

CC @queenp

from ideas.

kazarmy avatar kazarmy commented on May 29, 2024

I've run r2 in a (Linux) Emacs shell and it works fine for RTL and Arabic shaping (visual mode is unusable though). For consoles that don't support RTL, implementing a full-fledged Unicode Bidirectional Algorithm in r2 appears to require humongous and probably-not-worth-it effort but a simple algorithm that reverses Arabic and Hebrew character sequences shouldn't be hard to do. An Arabic shaping algorithm shouldn't be hard to do either.

from ideas.

XVilka avatar XVilka commented on May 29, 2024

May be have an option to work with FriBiDi somehow for bidirectional texts. But first, all visual modes should be fixed to properly work with Unicode and RTL chars.

from ideas.

kazarmy avatar kazarmy commented on May 29, 2024

May be have an option to work with FriBiDi somehow for bidirectional texts.

Yep. Output of:

r2 -c 'iz~Arabic:2' -q bins/pe/testapp-msvc64.exe | fribidi --nobreak

appears promising (testapp-msvc64.exe is an r2r binary).

from ideas.

XVilka avatar XVilka commented on May 29, 2024

We need better page for BiDirectional text support across terminals, like we did for TrueColors. So it will be easier to push terminal developers and easier track the progress.

from ideas.

XVilka avatar XVilka commented on May 29, 2024

radareorg/radare2#9608 is also related

from ideas.

XVilka avatar XVilka commented on May 29, 2024

@Vane11ope can you please try to enable the unicode reflines and stuff in the visual panels code?

from ideas.

XVilka avatar XVilka commented on May 29, 2024

@cyanpencil @Vane11ope @kazarmy please help to review the current state, and what is needed to be done.

from ideas.

cyanpencil avatar cyanpencil commented on May 29, 2024

@kazarmy do you for any chance have a binary on which we can test the things you just posted?

Or did you test them by inserting a comment in the disasm?

from ideas.

Maijin avatar Maijin commented on May 29, 2024

merged @kazarmy checkbox with main post

from ideas.

cyanpencil avatar cyanpencil commented on May 29, 2024

Btw, there are some UTF utility functions in libr/util/utf8.c / utf16.c / utf32.c. Better not to have duplicate code.

Unfortunately I knew the existence of that file, but did not read it throughly and re-implemented function r_utf8_decode... will fix it in the next pr

Thanks for the heads up!

from ideas.

XVilka avatar XVilka commented on May 29, 2024

From what I know shaping and diacritics will require dependency on ICU, no less. Those are very complex algorithms and depend highly on the language.

from ideas.

XVilka avatar XVilka commented on May 29, 2024

For a future reference - mintty/mintty#837

from ideas.

XVilka avatar XVilka commented on May 29, 2024

This library seems also interesting https://github.com/JuliaStrings/utf8proc

from ideas.

XVilka avatar XVilka commented on May 29, 2024

See also radareorg/radare2#12629

from ideas.

XVilka avatar XVilka commented on May 29, 2024

See https://terminal-wg.pages.freedesktop.org/bidi/ for details/proposal about BiDi

from ideas.

XVilka avatar XVilka commented on May 29, 2024

So it started: now implemented in VTE: https://terminal-wg.pages.freedesktop.org/bidi/implementations.html#vte

See also https://gist.github.com/XVilka/a0e49e1c65370ba11c17

from ideas.

XVilka avatar XVilka commented on May 29, 2024

Note, that with the release of GNOME 3.34 the support of BiDi is available in Gnome Terminal out of the box, which makes testing/implementing it in the other programs, such as radare2 way easier. FYI @deepakchethan

from ideas.

ret2libc avatar ret2libc commented on May 29, 2024

This issue has been moved from radareorg/radare2 to radareorg/ideas as we are trying to clean our backlog and this issue has probably been created a long while ago. This is an effort to help contributors understand what are the actionable items they can work on, prioritize issues better and help users find active/duplicated issues more easily. If this is not an enhancement/improvement/general idea but a bug, feel free to ask for re-transfer to main repo. Thanks for your understanding and contribution with this issue.

from ideas.

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.