Foreign language not read correct in SQL - sql

I have raw file with entry in Thai language " Yamato-Esulon (Thailand) Co.,Ltd (โรง 1)' but when i put that on SQL table it changes to 'Yamato-Esulon (Thailand) Co.,Ltd (Ó╣éÓ©úÓ©ç 1)' . I'm using datatype nvarchar(MAX). Has someone come across this before and how can this be prevented?

Your problem may be due to the font that you are using. Only certain fonts will work for thai language, so fonts like arial and calibri simply won't work.
For Thai, the fonts that work are:
Dialog, DialogInput, Monospaced, Sansserif, Serif, Leewaldee, Leewaldee UI, Leewaldee UI Semilight, Lucida Sans, Lucida Sans Typewriter, Microsoft Sans Serif, and Tahoma
This holds true for almost any other language, so be sure that a certain font works for the language that you are using. You can check which fonts work through a .jar file that I found online relating to an older post.

Related

How to get a font PostScript name?

I'm adding the possibility to embed Truetype fonts in the PDFs generated by my application, but the fonts "Sitka Text" (and it's variants "Sitka Banner", "Sitka small" and etc) and "Meiryo" don't embed.
I believe it is because I'm using the name from the LOGFONT object and to these fonts I should be using the PostScript name.
How can I obtain the Postscript name?
I obtained the 'name' table with GetFontData but the result didn't return any name I could use.
Is there any method on WINAPI that gives me that name?
Edit: I only show to my users fonts with the embedding permissions "Editable" and "Installable" which I obtain with the methods EnumFontFamiliesEx and it's CALLBACK function.
I also checked the NEWTEXTMETRIC ntmFlags that shows all my fonts are NTM_TT_OPENTYPE.
Edit2: By don't embed I mean that the PDF readers don't show my font as embedded (and Acrobat doesn't show any text)
An example of the error.
SOLVED
first, I'd like to thanks Michael Mckeough and mkl, You guys are Awesome and helped me a lot, I checked my original font and it wasn't damaged and I didn't change the font bytes, but then I finally noticed that if you call GetFontData to a (.ttc) file it will crop the ttcf part and no PDF reader will be able to understand what font it was.
Ideally, you would find this in the "name" table of the font. It would be nameId 0x0006, in a form useful for your platform. The format of the name table is a part of the TrueType and OpenType specifications. (You can find a copy here Microsoft Typography OpenType spec Name). There can be an awful lot of entries in the table, or there may be few. In particular, the Postscript name may or may not be present in any given font. You will need to look through the table for nameID of 0x0006, and a form (language, platform, encoding) that you can use. For postscript names, you most likely want them to be English, ASCII encoded, for any platform.
However, it is unlikely that the font is not embedding for this reason! A more common reason is that it is not legal to embed this font. In the Microsoft Typography OpenType Spec OS/2 you will see a field named fsType. This field contains flags indicating under what circumstances this font is licensed to be embedded. No Reputable tool will embed or subset this font is these flags indicate is it not licensed to be embedded.
I see that "Sitka Text" is a MS Windows 10 font, freely distributed by windows. It seems unlikely that It would not be licensed for embedding. Interestingly, the tool I usually use for "looking at" a font quickly (Font Validator, which used to be available from Microsoft Typography, but appears to no longer be) tells me that the OS/2 record is invalid. That it specifies a type of 5, and the spec says that type 4 is the latest. The correct response to a request to embed would require access to the fsType field, and if the record format was unknown, it should "fail safe", and refuse to embed the font.
So this is the most likely reason that the font will not embed for you.

Remove font using iText

I have a problem with my PDFs. They have a default font, Helvetica. This font is unused, but I need to develop a script that automatically deletes this font.
After asking two questions:
Unset PDF font with script
xhtml2pdf doesn't embed Helvetica
I finally discover iText. I've been trying to work with this library, and I made a few successful tests with Unembeding Fonts (example). But I can't find anything about deleting a whole font from de PDF.
Thanks a lot

Rules for Font Substitutions to / from PDF when using SSRS / ReportViewer to create PDFs?

In an effort to reduce the size of the PDF files exported from SSRS and the ReportViewer control, one of the main contributors to the size of a PDF is full and subset font embedding.
Ultimately, we decided to standardise our reports using only variations (size, bold, italic etc) of the Arial and Times New Roman fonts - fortunately most of our reports are corporate death-by-spreadsheet fare and not requiring aesthetic appeal.
During PDF creation, these fonts seem to then be substituted by ReportViewer/SSRS for one of the 14 PDF 'standard permissable fonts' (since the standard fonts aren't usually installed on most Windows machines anyway).
So my question is, what exactly are the rules that the PDF renderer on ReportViewer uses during font substitution, rather than embedding a font in the PDF?
Based on this site, and with a bit of trial and error, the following substitutions do seem to be made (from RDL to PDF, list is incomplete):
Times New Roman => Times
Courier New => Courier
Arial => Helvitica
I had thought that the substitution was forced because of font embedding legalities, but Times New Roman and Arial are both "Editable" which I understand to be the least restrictive.
There are a few conditions to be met when the pdf is rendered.
I suspect one of the parameters set out here are not met and converting your fonths to the closest one that fits.
Ensure the font is installed correctly and that font embedding is granted font; and
The font must be a true type font.

PDF Asian character support - JasperReports

I am trying to provide Asian character support for PDF documents created using Jasper Reports.
I have tried configuring jasper to use Asian character encoding with the iText-Asian libraries to no avail. For all of the different charsets I used the Asian characters always appear blank.
Has anyone successfully configured jasper reports to displayed Asian characters in PDF documents? If so How?!!
Yes. Font Extensions are the answer to everything. Well, at least they are the answer to this.
I wrote an article about font extensions. It shows specifically the case of Asian characters not showing up in the generated PDF, which appears to be your main symptom. By doing that you're sure to use a good font. And once you're using an appropriate font, then all your reports should be fine.

Fully Embedding True Type Fonts into PDFs

I am having problems creating PDF documents with fully embedded True Type fonts. I am printing from MS Word (and Indesign) to the Adobe 9.0 print driver. I can get .otf fonts to embed with no problem, but .ttf files will not embed. Is it possible to fully (not subset) embed these fonts? I am specifically having problems using WingDings. With other fonts, I have been able to find and purchase .otf versions and use those, but it does not appear that wingdings is available in this format and I do not know of another way to fully embed bullets (both sqaure and round).
The license for WingDings doesn't appear to allow you to fully embed them -- or too look at it another way, Acrobat doesn't appear to believe that it can fully embed them (and so subsets them instead). I'm not a copyright lawyer, so I'm not sure precisely what's allowed here, but here's some info that might help.
Install the font properties extension from Microsoft. This will give you much more information on the fonts properties. Once it's installed right-click on a WingDings font and and click on the 'Embedding' tab. You'll see this message:
"Embeddability for this font: Editable embedding allowed.
Editable embedding allowed: fonts may be embedded in documents, but must only be installed
temporarily on the remote system."
Then read this article from Adobe about Embedding Permissions. And this forum discussion might be of some use too.
I tried print a Word document which included WingDings to the Adobe PDF printer driver (Acrobat 8) and not matter which settings I tried, I was unable to get it to fully embed the font.
My guess is that Adobe interpret "Editable embedding allowed" to mean that you can only embed characters for the font which were included in the original document (i.e. embedded subset) and they are also the only ones which you can edit in the PDF.
I would try adding an additional page to the document that included every character in the font. Then use a different (non-Adobe) tool to delete that page. I don't have Windows so I can't tell you specifically how to do it. I can only tell you that I've used these kinds of tricks on other systems.