I'm using babel to convert .jsx file into vanilla javascript code. It contains some Chinese characters. I found that after conversion, the Chinese characters could not be displayed properly.
For example, instead of 甄, babel would transpile to \u7504.
I've looked up in their official documentation, bub did not find anything about this configuration. Is it possible to tell babel to automatically transpile all Chinese characters into something HTML-displayable?
Related
when i read the babel config file document that Babel will automatically search for a babel.config.json file, im curious about how babel find the babel.config.json and apply it, can somebody show me the code, thanks
I'm generating cshtml files dynamically for our CMS and using UTF-8 as encoding. I also tried to open those files using Notepad++ and it says that the encoding is UTF-8.
And I just use the controller's View() method to serve the page:
return View(path);
But it still improperly renders the special characters to a wrong one. Like 'α' becoming 'α', or single quote becoming '’'. The generated files when inspecting contains the correct characters, but when it getting served, it shows incorrect characters.
I found the issue and solution. The cshtml files should be written not by simple UTF8 format, but UTF8-BOM file format. Non-BOM UTF8 cshtml files' special characters were converted into something when getting served through return View(path);.
I just used tex4ht and htlatex to convert a latex document into html, and now i have some serious trouble to integrate this html document in a web site i'm making (I'm using Laravel though).I think one of the reason I have some troubles is that htlatex output files are Unix encoded, not utf-8. If I just input the file using Laravel views and controllers without any modification, utf-8 characters are not displayed, and if i convert the file to utf-8, all utf-8 characters turn weird within notepad and I have to rewrite them one at a time (the html files contains 2000+ lines, I can't do that).I'm wondering how can I solve the problem.Is "puting the input html in an iframe" tag an any good solution ? Or is there a way to encode this file to utf-8 without messing with his content ? I'm so lost....
tex4ht uses Latin1 as the default encoding, characters unsupported by this encoding are output as XML entities. You can request UTF-8 output using the following command:
htlatex filename.tex "xhtml,charset=utf-8" " -cunihtf -utf8"
As an alternative, you can use Make4ht with -u option:
make4ht -u filename.tex
make4ht is replacement for htlatex with much more features.
I'm using PhpStorm (and love it!), but the coding standard for my current project uses 4 space indents for .php files and 2 space indents for template files (.phtml). The template files are traditional php and HTML. Our code implements a standard Zend Framwork MVC setup.
Is there a way to configure PhpStorm to use one set of code style settings for *.php files and a different set of code style settings for *.phtml files?
Setting::File Type didn't work
I've tried associating .phtml files with the HTML file type, but that causes me to lose ALL php language assistance (no PHP syntax highlighting, no code assist, etc.).
Settings::Template Data Languages didn't work
I also looked for a solution using the the Template Data Languages setting. I setup my .phtml files to the File Type HTML, but PHP isn't an available setting, so it appears there is no way to add php language support for HTML files.
AFAIK it is not possible.
If you want to have PHP support, file extension has to be associated with PHP file type. That's the only way to have PHP support as PHP is not injectable language in current PhpStorm version/implementation.
You may utilize TextMate bundles support plugin and install PHP supported highlighting there. This will allow to assign .phtml extension to another file type. The drawback is that you can only have one language highlighting .. so HTML will not be highlighted + no code completion for actual PHP (that's as far as my simple experiments went with other not-yet-supported languages).
I can create the excel file just fine, the only problem is that when a field has a special character it shows up like so: ®
Is there something I should be doing before I save the file out?
There is a version of the as3xls library that can handle special characters and solves other issues
GitHub version as3xls
Download a ZIP of the library and include the "src/com" source files into your Flash Builder project