简体   繁体   English

TCPDF-缺少瑞典语字符

[英]TCPDF - missing Swedish characters

I'm using TCPDF in Codeigniter to generate PDF file. 我在Codeigniter中使用TCPDF生成PDF文件。

I have link from 'view' to 'controller' function that contains parameters. 我有从“视图”到“控制器”功能的链接,其中包含参数。 One parameter is name = 'Högskolan' . 一个参数是name ='Högskolan' When I get this parameter in controller and display in PDF sometimes it's displayed like 'Högskolan', sometimes like 'Hgskolan'(missing swedish character). 当我在控制器中获取此参数并以PDF格式显示时,有时会显示为“Högskolan”,有时会显示为“ Hgskolan”(缺少瑞典字符)。 This issue happens only in IE (sometimes - not always). 仅在IE中会发生此问题(有时-并非总是如此)。

Also there are differences when I save this file with File->Save as and File->Save . 当我使用File-> Save asFile-> Save保存此文件时,也存在差异。 With first option the file is saved as 'Hgskolan.pdf', with the second as 'Högskolan.pdf'. 第一个选项将文件另存为“ Hgskolan.pdf”,第二个文件另存为“Högskolan.pdf”。

What can caused these issues? 什么会导致这些问题? Any idea? 任何想法?

Thanks. 谢谢。

I would suggest doing something like this: Convert accented characters to their plain ascii equivalents 我建议做这样的事情: 将重音字符转换为它们的普通ascii等效项

You will find it works better to output without the accents (provided it doesn't substantially change the word of course). 您会发现在不带重音的情况下输出效果更好(前提是它不会实质性地改变字眼)。

As anttir suggested it's probably a browser specific issue or system issue not liking the characters. 正如anttir所建议的,这可能是特定于浏览器的问题或不喜欢字符的系统问题。 Can you test output on another browser or another platform to isolate the issue. 您可以在另一个浏览器或另一个平台上测试输出以隔离问题。

I'm not 100% sure if it's TCPDF tripping you up there, or the browser. 我不确定100%是否是TCPDF将您或浏览器绊倒了。 You can test that with something like Fiddler ( http://fiddler2.com/ ) or Charles ( http://www.charlesproxy.com/ ) [both debugging proxies]. 您可以使用Fiddler( http://fiddler2.com/ )或Charles( http://www.charlesproxy.com/ )[调试代理]进行测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM