is there a way to handle german umlauts in jsPDF? They are not rendered correctly, instead I get some unreadable symbols.
Best regards,
Stefan Lindmayer
Another user worked this out:
The problem is caused by the Base64 encoding lib which converts the document to UTF8 while the PDF itself states that it uses "WinAnsiEncoding".
For him it was solved by commenting out the following line in libs/base64.js:
input = Base64._utf8_encode(input);
Maybe that will work for you too.
Kind regards,
Chris
You also could also just use
ü = ue ö = oe ä = ae
that should work.
Related
How can I use characters like ö and é in konva.Text?
I have tried konva.Text within a demo: https://jsfiddle.net/64Love07/1/
Such special characters could be directly put in plain texts and actually I am still not sure what challenges within your situation.
Addtionally, some extra information could be helpful if this demo included answer still could not solve your problem perfectly.
Use String.fromCharCode(insert_code_here) to have text with these special characters.
For example, set the text attribute to String.fromCharCode(8730) to have √ in the Konva text.
To produce "ö and é" use:
String.fromCharCode(246) + " and " + String.fromCharCode(233)
I had tested in bookdown template, and found that “”, which is Chinese quotes, would be translated to ``,''。 But if you write “” in a block or other begin,end blocks, the Chinese quotes, “”, would not be translated to ``,''。So you will get different Chinese quotes, in the final pdf file. Can I set in some place to turn off such translation? Thank you.
I use another method.
% 解决双引号不一致的问题。
\newcommand\cqh{“} % chinese quote head
\newcommand\cqt{”} % chinese quote tail
or add space after ``''. The solution is not very good. I add md_extensions: -smart make no sense.
For English, `` '' works very well, but In Chinese, it becomes ugly. Hope pandoc become good enough.
I have a string which contains Swedish characters and want to convert it to basic English.
name = "LänödmåtnÖng ÅjädårbÄn"
These characters should be converted as follows:
Å use A
å use a
Ä use A
ä use a
Ö use O
ö use o
Is there a simple way to do it? If I try:
ascii_to_string = name.unpack("U*").map{|s|s.chr}.join
It returns L\xE4n\xF6dm\xE5tn\xD6ng \xC5j\xE4d\xE5rb\xC4n as ASCII, but I want to convert it to English.
Using OP's conversion table as input for the tr method:
#encoding: utf-8
name = "LänödmåtnÖng ÅjädårbÄn"
p name.tr("ÅåÄäÖö", "AaAaOo") #=> "LanodmatnOng AjadarbAn"
Try this:
string.mb_chars.normalize(:kd).gsub(/[^\x00-\x7F]/n,'').downcase.to_s
As found in this post.
You already got decent answer, however there is a way that is easier to remember (no magical regular expressions):
name.parameterize
It changes whitespaces to dashes, so you need to handle it somehow, for example by processing each word separately:
name.split.map { |s| s.parameterize }.join ' '
I'm trying to process a German word list and can't figure out what encoding the file is in. The 'file' unix command says the file is "Non-ISO extended-ASCII text". Most of the words are in ascii, but here are the exceptions:
ANDR\x82
ATTACH\x82
C\x82ZANNE
CH\x83TEAU
CONF\x82RENCIER
FABERG\x82
L\x82VI-STRAUSS
RH\x93NETAL
P\xF2ANGE
Any hints would be great. Thanks!
EDIT: To be clear, the hex codes above are C hex string literals so replace \xXX with the literal hex value XX.
It looks like CP437 or CP852, assuming the \x82 sequences encode single characters, and are not literally four characters. Well, at least everything else does, but the last line is a bit of a puzzle.
I am writing a document in spanish, and I'm trying to add 'í' to the word
Montréal.However if I put the i like this: \'{e} in the code below, I just get a space instead of the é. Why is this not working?
\begin{tabbing}%
\hspace{2.3in}\= \hspace{2.6in}\= \kill % set up two tab positions
{\bf Engineer}\> Panagro S.A.\> Summers 2004-2010\\
\>Montréal, Colombia
\end{tabbing}\vspace{-15pt}
Also I might add that when I try putting Montréal outside of the tabbing block, it works fine.
Ted
Tabbing environment
Some of the accent marks used in running text have other uses in the tabbing environment. In that case they can be created with the following command:
\a' for an acute accent
\a` for a grave accent
\a= for a macron accent
source: LaTeX/Accents at Wikibooks
Related question on tex.stackexchange with a great solution to accented characters.
Save your file as UTF-8 and put
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
in your preamble.
Then you can just type the characters normally into your source file.
Or, use XeLaTeX which accepts UTF-8 input natively. In that case you need to add
\usepackage{fontspec}
to your preamble.
If your text editor doesn't support UTF-8 encoded files, you should probably get another editor. But if you're stuck with one, you can also use:
\usepackage[latin1]{inputenc} % for PCs
\usepackage[applemac]{inputenc} % for Macs
and save the files in the default encoding for your machine.
Thanks to Alan Munn for the solution!