-
-
Notifications
You must be signed in to change notification settings - Fork 452
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #30106: sage.libs.ecl: Fix unicode handling
As a follow-up to #29278, #29280: If we use Unicode variable names in `SR`, declaring a domain gives an error: {{{ sage: SR.var('π', domain='real') RuntimeError: ECL says: THROW: The catch MACSYMA-QUIT is undefined. SystemError: <built-in method var of sage.symbolic.ring.SymbolicRing object at 0x334506908> returned a result with an error set }}} This comes from our ECL interface: {{{ sage: from sage.libs.ecl import * sage: u_symbol = EclObject('🔥') sage: u_symbol <repr(<sage.libs.ecl.EclObject at 0x337e7b3c8>) failed: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x94 in position 2: invalid start byte> sage: u_symbol.python() UnicodeDecodeError: 'utf-8' codec can't decode byte 0x94 in position 2: invalid start byte }}} Also note: {{{ sage: b_symbol = EclObject(bytes([166])) sage: b_symbol <repr(<sage.libs.ecl.EclObject at 0x337e7b058>) failed: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa6 in position 0: invalid start byte> }}} URL: https://trac.sagemath.org/30106 Reported by: mkoeppe Ticket author(s): Matthias Koeppe Reviewer(s): Markus Wageringel
- Loading branch information
Showing
4 changed files
with
76 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters