Sublime 3 forget default charset - character-encoding

I have problem with default charset in Sublime 3 (x64, portable version). I converted all my .pwn and .inc files (PAWN language) to Central Europe (Windows 1250) charset and it works fine.
Problem is because Sublime forget my default charset and when I open again file(s), it sets charset to Western (Windows 1252). Is here any way to set default charset which Sublime won't forget?
I searched but I didn't found correct way(answer). Thanks.

There are two settings you can use:
"default_encoding": "UTF-8",
"fallback_encoding": "Western (Windows 1252)",
Those are the default values, just change them to Central Europe (Windows 1250) in your user preferences and you should be all set.

Related

Delphi 7 cyrillic characters not showing correctly

i recently asked (and paid) for translation of my Delphi app to support Macedonian (Cyrillic font) support.
I posted text to translate to my contracted translator, she sent me back translated strings. The text was extracted from all my .dfm and .pas files
when i replaced the original text with cyrillic translation, i can open .dfm fies also .pas files in my favourite Notepad++ (or notepad) , and i see translated characters correctly.
When i open these files in Delphi (as dpr file) , i see something like this:
Please someone tell me how to convert/display these strings in Delphi correctly.
I am using Macedonian regional settings, but it not helped me with this problem.
PS: Yes I am still using Delphi 7 because i love it / purchased this version.
UPDATE
Original text in Delphi:
original: ПОДГОТВИ КУТИИ ЗРДРУГИТЕ ЦЕÐТРÐЛИ
Correct text:
ПОДГОТВИ КУТИИ ЗА ДРУГИТЕ ЦЕНТРАЛИ
I noticed, when i change ParentFont property to false and font set to Verdana and Cyrillic (RUSSIAN_CHARSET) , then i copy/paste cyrillic text, it shows normally in Delphi
OK so i SOLVED that!
The solution is multi step one, and Notepad++ is needed:
1st step: Replace all fonts in .dfm with (for example) Verdana , or some font that allows Cyrillic support
2nd step: Replace all ParentFont = False to ParentFont = True
3rd step: In notepad++ Choose: Encoding -> Convert to ANSI
that's all, do this for all .dfm and .pas file (only 3rd step)
i am happy to not Listened David Heffernan and not gave up!
Your text file was UTF-8 encoded, whereas Delphi7 requires WinAnsi encoding, with codepage 1251 for Cyrillic characters.
You have the UTF8Decode() function in System.pas to make the conversion programmatically, if you prefer.

Getting "Swiss Standard German, ss" character with UTF-8 collation

After searching in the archives I found a few resources that recommended replacing the character encoding (#1273 - Unknown collation: 'utf8mb4_unicode_ci' Cpanel).
This is what my collation was (CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;) and this is what I converted it to (CHARSET=utf8 COLLATE=utf8_unicode_ci). I also changed the collation in phpMyAdmin to utf8_unicode_ci. HTML meta charset is UTF-8. The problem persists. Issue can be viewed here by looking for words that have 'ss' in them: http://photonew.rasdesignmedia.com/about-roger-aguirre-smith/
Further testing shows that the problem does not exist with iOS. It persists in Chrome, Safari, Opera and Firefox.
The problem resided in my CSS and had nothing to do with collation at any level. Here is a link to more detail of what I found regarding CSS font-feature-settings: https://wordpress.stackexchange.com/a/281076/126173

Android ESC/POS protocol printing in Cyrillic

I bought a no-name Android ESC/POS printer, it support Bluetooth. I need help in printing Cyrillic symbols in Windows-1251 charset. What I do first:
\x1B\x40 (ESC # to initialize printer)
\xD5\xD3\xC9\n (the text that I need to print, standard Windows-1251 symbols, but it shows me some abracadabra :))
I should say, that the charset is set to Windows-1251 on the printer (by the exe tool that comes with it)
Also I tried command \x1B\x74\x49 (it sets the Windows-1251 manually, but there is no effect). Any ideas what we can do with it? Thank you all.
You can try my app that print cyrillic text: https://play.google.com/store/apps/details?id=pe.diegoveloper.printerserverapp
Configure your ESC/POS printers on 'Quick Printer' and print from your app.
I tried many variants and after this manual end up with this character code page settings { 27, 116, 9 }
outputStream.write(new byte [] { 27, 116, 9 });
outputStream.write("Привет Мир".getBytes("cp866"));
outputStream.write(PrinterCommands.LF);
Try to convert your text to cp866.
And set code page in printer via ESC/POS command into 17.
With Universal Cyriclic decoder you can find your source encoding/decoding.
Enter in decoded field your output text. For example 袩褉懈胁械褌.
Select source encoding UTF-8.
Then find your wanted decoding charset by selecting field "display as".

Zebra ZQ520 printer, download and use new .CPF font with ZPL language

problems to print with different fonts on my Zebra ZQ520:
as described in documentation, I've downloaded some new font through the official Zebra Font Downloader program, comic and verdana. After this, I found the new fonts in E: storage area. So the script:
^XA^HWE:^XZ
give me:
LIST OF FONT LINKS
- DIR E:.
* E:COMIC_02.CPF 7359
* E:VERDAN02.CPF 163 ....
- 66589184 bytes free E: ONBOARD FLASH
and trying to print example string from font downloader program, it print with the installed font with success.
The problem appens if I try to print a label. The printer seems not consider the .CPF files in ZPL commands.
My tests, without success, are:
1) following the procedure indicated in https://km.zebra.com/kb/index?page=content&id=SO7891 , assigning a designator to new font, with the script:
^XA^CWQ,E:COMIC_02.CPF^XZ
and trying to print something as:
^XA^FO50,50^AQN,50,50^FDSAMPLE CoMiC^FS ^XZ
seems not working (is it not possible to assign a designator on .CPF files??)
2) (not working too) test, I tryed to print something with the ^A# command, also without success. Example:
^XA^FO50,50^A#N,50,50,E:COMIC_02.CPF^FDSAMPLE CoMiC^FS ^XZ
Where is the problem? with printer (updated with the last firmware, V76.19.15Z)?
or ZPL can't print font stored in .CPF files?
or ..??
thanks!
The ZQ500 supports multiple printing languages. It ships with the PnP string stating that it is a CPCL printer. This tells the Zebra Setup Utility to generate a CPCL compatible font (.CPF). Since you are looking to print using ZPL you need to generate a font compatible with ZPL.
https://km.zebra.com/resources/sites/ZEBRA/content/live/SOLUTIONS/8000/SO8535/en_US/ZebraNet_Bridge_Font_Converting.pdf
This will use a different program to package a .ttf font for the printer. ZPL has support for truetype fonts so you will have better scaling of the font.
The ^CW and ^A# commands will both work with the ttf font.

Grails spaces decoded as plus signs if parameter text is ASCII

I have a problem in my production Grails app with decoding POST request parameters.
Whenever a parameter contains ASCII characters only, all the spaces in the text are decoded as '+' signs. So, instead of 'this is a test' controller gets 'this+is+a+test' parameter value.
More to that, if the parameter text contains even a single non ASCII character, say, we replace latin 'a' with cyrillic 'a', the problem is gone.
And yes, everything is Ok while running application on Windows 7 development machine in Intellij Idea IDE 11.x or as a war archive deployed to standalone local Tomcat 7.0.29.
The production app is deployed as war archive with all dependencies to Ubuntu/Tomcat 7.0.21 on SSL connector port 8443. The connector is configured with attribute URIEncoding="UTF-8"
The settings in Config.groovy are
grails.views.gsp.encoding = "UTF-8"
grails.converters.encoding = "UTF-8"
grails.views.gsp.sitemesh.preprocess = true
All gsp's have meta declaration http-equiv="Content-Type" content="text/html; charset=UTF-8" in the head element.
The application plugins are webxml:1.4.1, tomcat:$grailsVersion, hibernate:$grailsVersion, spring-security-core:1.2.7.3, spring-security-openid:1.0.4
As a last attempt I tried to upgrade Grails version from 2.2.0 to the latest 2.2.2 but no result.
It seems my case is opposite to many others like these
Grails request parameters encoding issue in Tomcat
http://9exception.com/question/168139
Form Encoding Problems on GRAILS 2.0
Grails not encoding the unicode characters properly
Can anyone help?
Thanks.
I've finally solved the space problem by upgrading Tomcat version from 7.0.21 to 7.0.39. No application files have been modified.

Resources