Skip to content

Commit

Permalink
ensure 4 characters wide unicode symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Sep 2, 2016
1 parent 6f6ae96 commit dd32401
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion meta/FSMathLink.m
Expand Up @@ -134,7 +134,7 @@
];

ToUTF8String[s_] :=
StringJoin[("\\u0" <> IntegerString[#,16])& /@ ToCharacterCode[ToString[s]]];
StringJoin[("\\u" <> Utils`FSStringPadLeft[IntegerString[#,16], 4, "0"])& /@ ToCharacterCode[ToString[s]]];

ToVaildWolframSymbolString[par_?CConversion`GreekQ] := ToUTF8String[par];
ToVaildWolframSymbolString[par_] := ToString[par];
Expand Down
5 changes: 5 additions & 0 deletions meta/Utils.m
Expand Up @@ -84,6 +84,8 @@ occurrence of the given rule is replaced (if it exists) or added (if

FSImportString::usage = "Returns the content of a file in form of a string. If the file does not exist, \"unknown\" is returned.";

FSStringPadLeft::usage = "StringPadLeft[] for Mathematica 9 and below.";

Begin["`Private`"];

ApplyAndConcatenate[Func_, l_List] :=
Expand Down Expand Up @@ -152,6 +154,9 @@ occurrence of the given rule is replaced (if it exists) or added (if
]
];

FSStringPadLeft[str_String, width_, pad_String] :=
StringJoin[PadLeft[Characters[str], width, pad]];

ForceJoin[elem___] :=
Join[Sequence @@ Select[{elem}, (Head[#] === List)&]];

Expand Down

0 comments on commit dd32401

Please sign in to comment.