Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thai language characters #23

Closed
jtcaudill opened this issue Jun 28, 2017 · 2 comments
Closed

Thai language characters #23

jtcaudill opened this issue Jun 28, 2017 · 2 comments

Comments

@jtcaudill
Copy link

jtcaudill commented Jun 28, 2017

Thai language is not displaying properly in UIWebview.  We are running the html string through SwiftSoup, and the resulting string is manipulating the Thai characters.  Here is the test example I've created:

"<br>\r\n<br>\r\n<font size=\"2\" face=\"sans-serif\">Lorem Ipsum บังคับ Amet นั่ง, consectetur adipiscing Elit Maecenas หุบเขาญี่ปุ่นเพียงอย่างเดียว ตอนนี้เวลาที่จะลงทุนโปรตีน เสียงนุ่มของสมาชิกในการไว้ทุกข์ VespaCam หุบเขากล่อง การเชื่อมโยงเว็บไซต์ Semper ใน ประสิทธิภาพการทำงานของเส้นผ่าศูนย์กลางใด ๆ แต่การดูแลผู้เล่นฟุตบอลสำนักฟุตบอลสมาร์ทและเรียงลำดับความต้องการ สดนำไปหักลดหย่อนเส้นผ่าศูนย์กลาง ID Ut Libero แต่ละช่วงเวลา lorem ถั่วลิสงได้บังคับ แต่ dui ราคา malesuada แต่ละเครือข่ายแครอทวันหยุดสุดสัปดาห์ ไม่มีน้ำซุปหรือซอส ullamcorper ullamcorper กลัวใครใหญ่กว่าลูกศรสารต้านอนุมูลอิสระ</font>"

We then take this string and run it through SwiftSoup.parse using this code:

let originalDocument = try SwiftSoup.parse(testString.replacingOccurrences(of: "\r\n", with: "\n"))

This is the result output:

Document <html><head></head><body><br> <br> <font size="2" face="sans-serif">Lorem Ipsum บงคบ Amet นง, consectetur adipiscing Elit Maecenas หบเขาญปนเพยงอยางเดยว ตอนนเวลาทจะลงทนโปรตน เสยงนมของสมาชกในการไวทกข VespaCam หบเขากลอง การเชอมโยงเวบไซต Semper ใน ประสทธภาพการทงานของเสนผาศนยกลางใด ๆ แตการดแลผเลนฟตบอลสนกฟตบอลสมารทและเรยงลดบความตองการ สดนไปหกลดหยอนเสนผาศนยกลาง ID Ut Libero แตละชวงเวลา lorem ถวลสงไดบงคบ แต dui ราคา malesuada แตละเครอขายแครอทวนหยดสดสปดาห ไมมนซปหรอซอส ullamcorper ullamcorper กลวใครใหญกวาลกศรสารตานอนมลอสระ</font></body>
</html>

@scinfu
Copy link
Owner

scinfu commented Jun 28, 2017

Hi @jtcaudill thank you for your report.
As we discussed it by email, the error was in the escape of the characters.
Not it's fixed in the pod version 1.4.1(312cb57), please update and be sure of the right version.

@jtcaudill
Copy link
Author

Yes, version 1.4.1 fixed the issue. We were using 1.3.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants