I have a JavaScript library that is rendered as escaped characters instead of accented characters:
if (titre == "Directeur G\u00E9n\u00E9ral / VP / Pr\u00E9sident") {...
instead of :
if (titre == "Directeur Général / VP / Président") {...
I am using Notes 9.0.9FP9 and IE11 (does the sasmething in Chrome).
Any ideas why? It seems all JS librairies have the same behavior so I'm guessing it's a database setting somewhere???
: )
Make sure you set "UTF-8" in preferences
"General / Workspace"
and in project preferences "Recourse"
Related
Is there a way to disable the html/tidy plugin for syntastic for a certain file?
I have a handlebars template that contain an empty <tbody></tbody> tag as a placeholder, and I keep getting the error
trimming empty <tbody> [html/tidy]
Is there a way to either disable this specific rule, or just disable the html/tidy plugin for this specific file?
Try to put this in your .vimrc
let g:syntastic_html_tidy_ignore_errors=[" proprietary attribute " ,"trimming empty <", "unescaped &" , "lacks \"action", "is not recognized!", "discarding unexpected"]
This solves more things than one but I think it can be helpful. More on this here.
I was running into this with .hbs and .html templating for a node project. Adding this to my .vimrc helped:
let syntastic_mode_map = { 'passive_filetypes': ['html'] }
more options here https://github.com/scrooloose/syntastic/issues/240
Additionally, if you just want to turn warnings off for html tidy:
let g:syntastic_html_tidy_quiet_messages = { "level" : "warnings" }
I have found this is a welcome setting for editing twig templates.
Of course for more info, in vim:
:h syntastic-checkers
Is it possible to display the Euro symbol in pdfkit for nodejs without having to embed an external font?
I am using pdfKit to generate invoices and would like to prefix my currency amounts with the Euro Symbol (€).
I've tried a number of approaches and none worked:
doc.font('Helvetica-Bold')
.fontSize(12)
.text('€', 10, 10); // Alt+0128 on keypad
doc.font('Helvetica-Bold')
.fontSize(12)
.text('\u20AC', 10, 10);
Turns out it is a font issue:
unicode works, but you have to make sure that the font you are using
includes the characters you want to use. Unlike your operating system,
PDFKit does not do any automatic font substitution.
Source: Reddit Thread comment by /u/devongovett
I tested two fonts that were included with pdfkit. Both 'Helvetica-Bold' and 'Times-Roman' didn't work with the unicode symbols. I noticed in the documentation for fonts that you can add in your own fonts, so I gave the Cardo Font (hosted on Google Fonts) a go as it supports many unicode characters.
Sure enough, it worked. Here is the script I used for testing (Make sure you have the Cardo font available):
var PDFDocument = require('pdfkit');
var doc = new PDFDocument();
doc.registerFont('Cardo', 'Cardo/Cardo-Regular.ttf')
doc.font('Cardo')
.fontSize(20)
.text('Testing [\u20AC]', 10, 10);
doc.write('out.pdf');
If you're set on using Helvetica-Bold, download a copy of the font elsewhere (make sure it supports the unicode characters you're after) and register it as I have with the Cardo font.
I want to switch from Selenium to Poltergeist but I need to simulate a barcode scanner that looks like keyboard entry to the <body> tag. I use this code with Selenium:
native.send_keys(send_key)
Is there a way with Poltergeist to send a string of keys to an arbitrary element (ie, not an input)?
Poltergeist now has send_keys support:
element = find('input#id')
# send a simple string
element.native.send_key('String')
# send a series of keystrokes
element.native.send_keys('H', 'elo', :Left, 'l') # => 'Hello'
# symbol for special keys
element.native.send_key(:Enter) # triggers Enter key
Since PhantomJS 1.7 (released 2012-09-22), you can send keyboard events to the headless browser using page.sendEvent.
The documentation includes an example simulating shift-A:
page.sendEvent('keypress', page.event.key.A,
null, null, 0x02000000 | 0x08000000 );
How exactly that input is handled by the page (i.e. what's targeted) will depend on the state of the page, such as where the focus is.
No, there is no way to do this at present. PhantomJS does provide an API for this, so it could be added in the future, but it's not currently supported.
I'd suggest trying to generate the DOM keyboard events in Javascript. Or just keep those specs using Selenium and use Poltergeist for the rest.
Starting from version 1.5.0, poltergeist supports basic send_keys.
https://github.com/jonleighton/poltergeist/blob/master/CHANGELOG.md#150
I am using JSF 2.0 and I have text field as
<h:form>
<h:inputText value="#{myBean.myValue}" />
<h:commandButton value="Submit" action="#{myBean.printMe()}" />
</h:form>
public void printMe() {
System.out.println("first line==" + myValue + "==");
System.out.println("second line==يشسيبشسيبشسيبشيس==");
}
When I run this project and enter يشسيبشسيبشسيبشيس in textbox, in IDE console I see as below.
INFO: first line==????????????????==
INFO: second line==????????????????==
Any idea why this is happening?
This is caused by using the wrong console encoding.
The line
System.out.println("My Data is " + fullName);
prints to the standard output (stdout). You need to configure it to use UTF-8 as well. Assuming that you're using Eclipse, then you need to change the stdout encoding to UTF-8 by Window > Preferences > General > Workspace > Text File Encoding.
If you're using Netbeans, which I can't answer from top of head, head to this answer: hebrew appears as question marks in netbeans which contains a link to this Netbeans Wiki which mentions the following:
To change the language encoding for a project:
Right-click a project node in the Projects windows and choose Properties.
Under Sources, select an encoding value from the Encoding drop-down field.
See also:
Unicode - How to get the characters right?
Unrelated to the concrete problem, those lines in the filter are unnecessary
res.setCharacterEncoding("UTF-8");
res.setContentType("text/html;charset=utf-8");
They defaults in case of JSF2/Facelets to proper values already. Remove those lines.
If the data comes from a DB, please check the field datatype is nvarchar.
I know that normal script tags can't self close, and I know less of vimscript than I might. I have been working with a custom XML templating language quite similar to HTML, and have been using the HTML mode along with the file ~/.vim/after/syntax/html.vim:
syn region javaScript start=+<is:PageComponents:Script[^>]*>+ keepend end=+</is:PageComponents:Script>+me=s-1 contains=#htmlJavaScript,htmlCssStyleComment,htmlScriptTag,#htmlPreproc
syn region htmlScriptTag contained start=+<is:PageComponents:Script+ end=+>+ contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent
The problem that I am experiencing is "spillover" of the highlighting region until the end of the file or the next closing script tag.
I have attempted changing start to: +<is:PageComponents:Script[^>]*\(\\\)\#<!>+, and +<is:PageComponents:Script[^>]*[^\\]>+, neither of which make a difference. As far as I understand regexes, the negative lookbehind should have been an ideal solution, and the one character match should have forced the greedy star to back off one character, resulting in failure. Replacing the * with \{-} for ungreedy behavior has the same result. What am I missing?
In case it's relevant, I'm running vim in Cygwin's mintty (type is xterm-256color), shell is bash, color scheme is solarized.
Edit: Adding sample of our markup language
<is:PageComponents:Template title="Page Title" controller="controller">
<is:PageComponents:Script src="/path/jsfile.js" />
<is:PageComponents:Style src="cssfile.css" />
<is:Containers:Box label="Box Label">
<is:DataGridComponents:DataGrid id="data_grid_id" data_provider="data_provider" keep_state="true">
<is:DataGridComponents:DataGridHeader />
<is:DataGridComponents:Columns strip_placeholders="false" id="%%id%%_row">
<is:DataGridComponents:Column header_title="Links Header">
<span class="popup-link popup-link-type1" id="type1_%%id%%">Type 1</span> |
<span class="popup-link popup-link-type2" id="type2_%%id%%">Type 2</span>
</is:DataGridComponents:Column>
<is:DataGridComponents:Column header_title="Data1">%%data1%%</is:DataGridComponents:Column>
<is:DataGridComponents:Column header_title="Data2">%%data2%%</is:DataGridComponents:Column>
</is:DataGridComponents:Columns>
<is:DataGridComponents:DataGridFooter>
<is:DataGridComponents:Pager id="pager_id" data_provider="pager_data_provider" for_component="data_grid_id" />
<is:Containers:Box id="footer_box_id" data_provider="footer_box_data_provider">Text: %%data%%</is:containers:box>
</is:DataGridComponents:DataGridFooter>
</is:DataGridComponents:DataGrid>
</is:Containers:Box>
<is:PageComponents:Script location="onready">
{literal}
// Insert literal JavaScript code here for the page
{/literal}
</is:PageComponents:Script>
{include file="path/file1.tpl"}
{include file="path/file2.tpl"}
</is:PageComponents:Template>
Both of my patterns worked correctly when I switched to using / instead of \ in my match.
The corrected patterns are:
+<is:PageComponents:Script[^>]*\(/\)\#<!>+ and
+<is:PageComponents:Script[^>]*[^/]>+.