Escape character for parameter in function of EL - jsf

I have this element in my page:
<p:panel header="Advies van de dienst aangemaakt op: #{of:formatDate(advies.aangemaaktOp, 'dd/MM/yyyy HHumm')}">
It renders to:
Advies van de dienst aangemaakt op: 30/03/2016 14357
It should be:
Advies van de dienst aangemaakt op: 30/03/2016 14u57
How do I achieve this? I know I should find a way to escape the 'u' character but since I am in a parameter of a function in an expression of EL, I cannot find a solution to do it.
Suggestion on the internet which doesn't work is using the tick '.
Tried also to escape with backslash but also no luck

The solution is 'dd/MM/yyyy HH\'u\'mm'. I had to escape the tick itself.
Complete element:
<p:panel header="Advies van de dienst aangemaakt op: #{of:formatDate(advies.aangemaaktOp, 'dd/MM/yyyy HH\'u\'mm')}">

Related

How to disable Smart punctuation in flutter textfield ? Problem when a String contains the apostrophe sign : " s'habiller", "Brin d'herbe"

Am encountering a problem when a string contains an apostrophe (single quote). Am developing a vocabulary learning app (French / English). The user must answer quizzes. The phone tells the user if what he/she types is the correct translation.
Whenever there is an apostrophe, the string is not recognized.
Ex : "A blade of grass" : "un brin d'herbe" / "A beehive" : "Un nid d'abeilles".
To check the answer, I split the chain into a list : [un,nid,d'abeilles]
Even if the user types "d'abeilles", it's never recognized as correct.
I noticed the same problem with the speech to text functionality : if the user says the word "s'habiller" (to get dressed), it is never found by my search function.
Anyone sees why this happens ? Would it be a "flutter" bug ?
In the app, I have a wordbank which was created with Microsoft Excel and then imported into visual studio. The wordbank is made up of WORD objects that have a series of parameters. Here is the one for blade of grass.
Word(
id: 37,
level: 6,
main: "blade of grass",
mainFr: "brin d'herbe",
theme: [
T(
e: "house",
f: "maison",
ste: ["in the garden"],
stf: ["dans le jardin"]),
T(
e: "nature",
f: "nature",
ste: ["in the meadow"],
stf: ["dans la prairie"])
],
articleEng: "a",
articleFr: "un",
nature: "noun",
plur: "blades of grass ",
ortho2: "",
phon: "ˈbleɪd əv ˈgrɑːs",
son: "",
remPhon: "",
french: [],
syn: [],
ant: [],
wDef: "a single thin flat piece of grass.",
wPhrase: "There was no wind at all. Not a leaf or blade of grass moved.",
wPhraseFr:
"Il n'y avait pas de vent du tour. Pas une feuille ni un brin d'herbe ne bougeait.",
past: [],
idiomsEn: [],
idiomsFr: [],
marqueur: "",
remarque: "",
),
I finally found the solution for this problem. It was indeed created with Apple's implementation of SMART PUNCTUATION. It is easy to disable it when using a textfield :
TextFormField(
smartQuotesType: SmartQuotesType.disabled,

Nodejs encode string ISO8859-1

I've been looking for an answer for some days.
I am receiving data per post from a form containing special characters (accents)
eg : Está é uma sala de teste
App Node: Est%E1+%E9+uma+sala+de+teste
What is the correct way in nodejs, to decode the string to save to in my database?
I did it that way. But I'm sure it's not the right way
decode string with accents
My apologize if this is a duplicate issue, but not that I found myself able to resolve the issue
thank you any advanced.
You can use a module like iconv-urlencode for that:
const conv = require('iconv-urlencode');
let input = 'Est%E1+%E9+uma+sala+de+teste';
console.log( conv.decode(input, 'latin-1') );
// Está é uma sala de teste

vim text replacement : :%s/é/&&eacute/g foreign language

I have a text with multiple french character: I'm trying to replace all the occurrences for an HTML code
example été to get => été
right now I'm having either error or a weird text
:%s/é/&é/g => this gives me a ééeacute;tééeacute;
:%s/é/&é/g => this gives me a éeacute;téeacute;
:%s/é//é/g => this gives me an error Trailling character
In the replacement part, & is special, it represents the whole match:
J'ai mangé du paté de campagne.
:s/é/&´/g
J'ai mangéacute; du patéeacute; de campagne.
Escape it to obtain the desired &:
:s/é/\´/g
J'ai mang´ du paté de campagne.

Remove special characters in sed script

I'm having a hard time removing º and ª in a sentence.
For instance, given this line:
s. ex.ª mandava: e como esse inverno ia seco
I would like to remove "s. ex.ª", ending up with:
mandava: e como esse inverno ia seco
I have tried (without success) the following regex:
s/s. ex.\ª//g
s/s. ex.ª//g
s/s. ex.[ºª]//g
What am I doing wrong?
Changing the input file to utf-8 solved my problem, marking the question as solved.
Thanks again to #ikegami, for pointing me in the right direction.

What encoding is this and how can I decode it?

I've got an old project file with translations to Portuguese where special characters are broken:
error.text.required=\u00C9 necess\u00E1rio o texto.
error.categoryid.required=\u00C9 necess\u00E1ria a categoria.
error.email.required=\u00C9 necess\u00E1rio o e-mail.
error.email.invalid=O e-mail \u00E9 inv\u00E1lido.
error.fuel.invalid=\u00C9 necess\u00E1rio o tipo de combust\u00EDvel.
error.regdate.invalid=\u00C9 necess\u00E1rio ano de fabrica\u00E7\u00E3o.
error.mileage.invalid=\u00C9 necess\u00E1ria escolher a quilometragem.
error.color.invalid=\u00C9 necess\u00E1ria a cor.
Can you tell me how to decode the file to use the common Portuguese letters?
Thanks
The "\u" is prefix for unicode. You can use the strings "as is", and you'll have diacritics showing in the output. A python code would be something like:
print u"\u00C9 necess\u00E1rio o texto."
which outputs:
É necessário o texto.
Otherwise, you need to convert them in their ASCII equivalents. You can do a simple find/replace. I ended up writing a function like that for converting Romanian diacritics a while ago, but I had dynamic strings coming in...
Smell to me like this is unicode?
\u = prefix unicode character
00E1 = hex code for the 2 byte number of the unicode.
Not sure what the format is - I would ask the sencer, but i would try this approach to decode it.
found it ;)
http://www.fileformat.info/info/unicode/char/20/index.htm
Look at the tables with source code. This can be a C++ source file. This is the way you give unicodde characters in source.

Resources