Does angular dart have a built in function to remove illegal file-name characters from a string - angular-dart

In angular dart (using Visual Studio Code) If the user-clicks on a report such as "A/R Listing" to export to a CSV file. I need to remove the "/" from the name. I know I can just to a string replace for "/" but since the name of the report can be customized, it could be anything. Is there a function native to dart that knows which characters are illegal or does that all have to be done manually?
Thanks

Related

How to fix "ICU Syntax Error: Expected > "identifier" but found "0"." error in Flutter 3.7.0

After Updating to Flutter 3.7.0 i get this error message when i build my App:
[app_en.arb:scanCode_fieldNotMatched] ICU Syntax Error: Expected
"identifier" but found "0".
field to match is "{0}"
It seems as if something had changed in how the variables are written in the .arb localization files.
UPDATE 1: Escape syntax characters!
If what you are trying is to use the characters {, }, ' (or any other syntax character for that matter) in your strings, then you will have to escape them. To do that enable the use-escaping flag by adding the following to l10n.yaml
use-escaping: true
Now use pairs of single quotes to escape syntax characters, like "{". To escape single quotes you just have to write it as a double-single quote as follows:
{
"some_text": "Using the '{' character '{isn''t}' trivial?"
}
More details on this in the flutter docu.
Update 2: If you are using a Chinese Mirror for Flutter
Follow details in this issue.
Original answer to my punctual problem
I found out that the reason for this error is that in Flutter 3.7
Internationalization support has been completely revamped! [they]’ve completely rewritten the gen-l10n tool...
as stated in a release post.
Previously i was declaring strings in my .arb file as follows
"scanCode_fieldNotMatched": "field to match is \"{0}\"",
where afterwards i was replacing {0} by some other value.
Well, it seems that now the gen-l10n tool takes what is between brackets as special parameters, and the name "0" is not accepted so i had to change my string to
"scanCode_fieldNotMatched": "field to match is \"{value0}\"",
and AppLocalizations can be now called as:
AppLocalizations.of(context)!.scanCode_fieldNotMatched("something here to replace value0!")
Further details on this can be found here: Placeholders, plurals, and selects in Flutter.
In my case, it was due to a translation string in my arb file for intl package. I had:
"{x, plural, =1{item}, other{items}}" (worked fine in previous versions)
This broke in Flutter 3.7. The solution for me was removing a comma:
"{x, plural, =1{item} other{items}}" (works in Flutter 3.7)

How to fix ICU Lexing Error: Unexpected character in Flutter

I am using flutter_localizations to localize my app.
Since updating to Flutter 3.7 i am getting this error:
ICU Syntax Error: Expected "identifier" but found "}".
This =|(){}[] obviously
This =|\(){}[] obviously is the text that i have in my .arb file.
I understand that curly braces "{}" have a special meaning and should be escaped, but i can not find the way to correctly escape them, has anyone managed to do so?
One simple way to reproduce the issue is simply following the steps to add localization support here, and then instead of the hello world string, write anything that includes the character "{".
P.S.: There is a releted issue open on Github. Be sure to go and check there for updates!
There is an escaping syntax that is implemented but not enabled by default as it is a new feature that wasn't completely backward compatible with existing ICU message strings.
First, add the following to your l10n.yaml file:
use-escaping: true
Then, this will allow you to wrap parts of your strings in single quotes to ignore any syntax within the single quotes; to use a single quote normally as a character and not an escape, use a double single quote. For example,
{
message: "This '{isn''t}' obvious"
}
becomes
String get message => "This {isn't} obvious";
See here for information on the syntax. I'll add this to the documentation later.

Capture File name from File Browser Item Field in Oracle Apex

I want to capture file_name and store it in another item field at run time using dynamic action.
I tried it to capture File Browser Item field but its capturing entire file path.
Please suggest if this can be done using PLSQL or JS in Oracle Apex 4.2
You can use regular expression, relying on the fact that there is always a backslash before the filename:
$('#P6_FILE').val().match(/\\([^\\]*)$/)[1]
explaining the regular expression:
\\ double backslash: escaping the backlash
() parenthesis to dig out the filename from the result that initially includes backslashes
[^\\]* any letter that is not a backslash, as many times as you'd like
$ end of string
Stackoverflow sometimes escapes backslashes itself, so this might look messy
$('#P6_FILE').val().match(/\([^\]*)$/)[1]
this has worked in DA set value
I use this SQL to get the file name from the file browser :
select filename
FROM apex_application_temp_files
where name = :P2_FILE_SELECT;
P2_FILE_SELECT is the file browser item.
Write this SQL into "SQL Query" of SOURCE.

Highlight html syntax inside string?

Is there a way (plugin, option, or tip and trick) to highlight html syntax in a js string?
My document is .JS file, in which I use strings containing html code. Is it possible highlight html syntaxe inside these strings?
You can use the extension es6-string-html
Note: You need to add a comment with the language in front of the multiline string
The extension that you suggested requires that you prefix your strings with a comment like /*html*/ or html. I'm working with Angular, and I didn't want to go through all my templates to prefix them, so I found this extension that does it automatically without prefixes:
https://marketplace.visualstudio.com/items?itemName=natewallace.angular2-inline
It is included in the Angular Essentials package by John Papa:
https://marketplace.visualstudio.com/items?itemName=johnpapa.angular-essentials
For Vue try Vue Inline Template:
https://marketplace.visualstudio.com/items?itemName=faisalhakim47.vue-inline-template

"IO error while decoding Routes.scala with UTF-8" when compiling Play Framework project

When I compile my project, the console will show:
[error] IO error while decoding Routes.scala with UTF-8,Please try
specifying another one using the -encoding option"
What might be the reason for this error?
You might have smart quotes or other Microsoft specific encoded characters in your routes file. This can often happen if you copy and paste from a Microsoft Word document or from the web into your file. Look for “ or ” or apostrophe characters that curl one way or another. Replace them in a programmer's text editor with regular straight quotes and single quotes.