Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by sanryoga · Jan 25, 2010 at 10:36 AM · guiutf-8

Text Encoding, WWW.UnEscapeURL

I'm having weird problems with the WWW.UnEscapeURL()

We're working on a french translation, but special characters don't show up. but as we all know changing the script to UTF-8 enables special characters, so when I print "" in my code on screen, it works.

Now the peculiar thing happens when I ask text from the server. I get the text from a php page and it encodes my text with rawurlencode (as suggested in another question on this site)

but when I use www.UnescapeURL(www.data), my special characters don't show up, the font I use is Unicode and works because when I print www.UnEscapeURL(www.datat)+"" on screen, the shows up, but in my log the special characters don't get decoded.

so my guess is that the %.. aren't aligned

I'll finish with a small example of what I encounter in my Debug.Log

Mais%20aussi%20un%20oiseau%20un%20peu%20b%EAte%2C%20n%27est-ce%20pas%3F

Translates To:

Mais aussi un oiseau un peu bte, n'est-ce pas?

so the %EA doesn't decode to

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image sanryoga · Jan 25, 2010 at 10:37 AM 0
Share

I also tried encoding it with System.Text.Encoding.ASCII, just to know what I'd get, and the missing characters get replaced by ?-marks

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by sanryoga · Jan 25, 2010 at 11:18 AM

After some intensive testing and experimenting, we've found that the rawurlencode was the problem

we just encoded via WWW.escapeURL and saw that there was a difference with rawurlencode throught testing it seems that (in php) urlencode(utf8_encode($string)); is the encoding you should use.

The strange thing is, I thought rawurlencode used to work when I was using 2.5, or was it just my imagination?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by jonas-echterhoff · Jan 25, 2010 at 11:19 AM

How was the text encoded before you escaped it to get the string "Mais%20aussi%20un%20oiseau%20un%20peu%20b%EAte%2C%20n%27est-ce%20pas%3F"?

The use of a single %EA to represent an accented character seems to indicate it was encoded in Windows-1252, not in UTF-8, which should generate two substitution characters. Try encoding the text in UTF-8 before escaping.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

degrees celcius symbol in unity 2 Answers

Umlaut shown as ?? in GUILayout.Button 3 Answers

UTF-8 for foreign language characters on GUI 2 Answers

UTF-8 Support in Unity iPhone 1.6? 2 Answers

GUI.PasswordField "•" makes "?" 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges