Bug 10393 – demangle doesn't work for unicode symbol names

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-17T11:35:00Z
Last change time
2017-06-25T18:12:42Z
Assigned to
nobody
Creator
sean

Comments

Comment #0 by sean — 2013-06-17T11:35:30Z
currently std.demangle.demangle doesn't work with unicode (see example below) If we decide to keep allowing unicode symbols (as opposed to just unicode strings/comments), we must address this issue. Will supporting this negatively impact performance (of both compile time and runtime) ? ---- struct A{ int z; void foo(int x){} void さいごの果実(int x){} void ªå(int x){} } mangledName!(A.さいごの果実).demangle.writeln;=>_D4util13demangle_funs1A18さいごの果実MFiZv ----
Comment #1 by naptimeentertainment — 2016-02-15T13:31:10Z
(In reply to Sean Kelly from comment #0) > currently std.demangle.demangle doesn't work with unicode (see example below) > > If we decide to keep allowing unicode symbols (as opposed to just unicode > strings/comments), [snip] I use unicode (Japanese) symbols extensively in my code. Please fix demangle rather than deprecate non-ASCII identifiers!
Comment #2 by hsteoh — 2016-02-18T00:39:24Z
Can't reproduce problem in dmd git HEAD. Has this been fixed, or am I misunderstanding something? Full program tested: ------ import std.demangle; import std.stdio; import std.traits; struct A { int z; void foo(int x){} void さいごの果実(int x){} void ªå(int x){} } void main() { mangledName!(A.さいごの果実).demangle.writeln; } ------ Output: ------ void test.A.さいごの果実(int) ------
Comment #3 by r.sagitario — 2017-06-25T18:12:42Z
seems correct to me too. With OMF there is an issue when symbols are compressed, because these interfere with UTF8, but that's not a problem of the demangler.