Discussion Forums  >  Uncategorized

Replies: 27    Views: 716

Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
02/24/11 07:45 AM (15 years ago)

Characters Solution!!

Jjjjjiiiihaaaaa!!! Hi David. Now I have come to the solution of strange characters. I just need to change a number in the Xcode project. Then I can enter åäö in the backend and the phone did not crash. and it read the characters correctly. I have another problem. I have a menu button with a lot of buttons. when I slide up the buttons them will disappear up under navigationbar?
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
02/24/11 09:10 AM (15 years ago)
I saw the message the other day about the special-chars, this is great news. The character set that the phone is using to save the downloaded text file - duh, did't even think of it during the times were looking into the problem. Good stuff, it'll really help. Buttons: How many buttons? What layout? (grid, vertical left, veritical right?). They should slide under the top and bottom navigation bars as the list / grid is scrolled up-n-down. Oh, maybe your'se saying the scoll, but scroll too far so they go out of sight totally? Lemme know the app + the screen nickname and I'll check into it. It's gonna be an easy fix ;-)
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
02/24/11 09:38 AM (15 years ago)
Hi Fist the buttoms. Button Layout Style = Grid, 10 buttons, nickname books, Appname Ledarskap.
 
Torben
Lost but trying
Profile
Posts: 25
Reg: Feb 10, 2011
Denmark / Germa...
250
like
03/17/11 11:45 PM (14 years ago)
@ Mackimack: Hi have the same problem with special characters like you had. when i use öäüß it crashes the app. what have you changed in the Xcode project to fix the problem? many greetings from denmark
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
03/18/11 12:12 AM (14 years ago)
@ Torben. Do you understand Swedish, or would you have an explanation in English? :)
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/18/11 12:46 AM (14 years ago)
@Toben: Mackimack went through great pains to figure this out and we owe him HUGE for his efforts. As it turns out, the the BT_fileManager.m class, the class that does all the data-saving, the saveStringDataToFile method takes an argument for the type of character encoding the data is. see BT_Objects / BT_fileManager.m, about line 268 Tinker with that method and see if you can get your data to 'not crash' In the meantime, we are working out a solution to allow app-owners to choose a character set in their control panels to try to prevent this. The biggets challenge is that different screens use different data and sometimes that data comes from different sources. Example: One RSS feed in your app uses one character set and another one uses another - tough to engineer around. We'll get it ;-)
 
Torben
Lost but trying
Profile
Posts: 25
Reg: Feb 10, 2011
Denmark / Germa...
250
like
03/18/11 07:36 AM (14 years ago)
@Mackimack did you get my mail? greetings torben
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
03/19/11 04:47 AM (14 years ago)
@ Torben no I have not received any email from you.
 
Torben
Lost but trying
Profile
Posts: 25
Reg: Feb 10, 2011
Denmark / Germa...
250
like
03/19/11 09:11 AM (14 years ago)
@Mackimack new mail send... i wish a nice weekend greetings torben
 
elaine
buzztouch Evangelist
Profile
Posts: 385
Reg: Dec 26, 2010
Ireland
3,850
like
03/19/11 10:49 AM (14 years ago)
Hello, I just got an email today from someone who wants to translate one of my apps into Swedish!! ;) I've never been translated in Swedish before :D I think from reading above (given my basic techy status) I will wait till the character set choice is in the control panel, unless Mackimack there is a quick swedish fix somwhere ;) Repayment in horse books lol! :D Thanks! Elaine.
 
Torben
Lost but trying
Profile
Posts: 25
Reg: Feb 10, 2011
Denmark / Germa...
250
like
03/20/11 02:11 AM (14 years ago)
@Mackimack hi again. No crashes and special characters are showing right. i changed line 302 from encoding:encodingFlag to encoding:9 is your solution the same? many thanks to david and you for pointing me in the right direction. many greetings Torben
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/20/11 02:31 AM (14 years ago)
Hi Torbin... just about done after a very long weekend of code when I saw your message. I'm not sure where you're implementing the character set flag but it occurred to me that this may help? There aren't too many places (really) that this is used. All of the file saving routines are called from Screen Controllers and a few other objects (like the app delegate). We're talking about all the places that STRING / TEXT type data is downloaded and saved to the phones file system. If you're not already looking at each screen controller in the BT_Screens folder, start there, You'll see in these files a line where the BT_downloader initiates a download. The BT_downloader object grabs the data from a URL then asks the BT_fileManager to save the data. The BT_downloader object and the BT_fileManager object are in the BT_Objects folder. The BT_fileManager saves the data in the saveStingDataToFile method. This method takes an argument for the encoding flag. Look at the method. This means that BT_downloader needs to send this flag when it asks BT_fileManager to save the data. It does this in it's connectionDidFinishLoading method. So, BT_downloader > connectionDidFinishLoading is where you should be looking and changing the character set. If you look at the connectionDidFinishLoading method, you'll see where it tries to figure out what type of file it just downloaded before it sets the character set flag (integer). In most cases, it looks uses the 'save as file name' to determine the character set. BT_downloader send a file name to it so it knows what to name the file it saves. Example: If the file it's saving is a 'TEXT' file, it sets the character set to 1 to tell BT_fileManager to use the NSASCIIStringEncoding character set. If it's an HTML or XML is sets it to 4 for NSUTF8StringEncoding This means you may be able to change only ONE line of code to get your character set to work. Example: You could say... hey downoader, if you just downloaded some XML data (like from an RSS feed), or some HTML data (like from another web-page), use character encoding 5 for NSISOLatin1StringEncoding. I would start by changing the 4 to a 5 (in BT_downloader) when it saves XML or HTML data. May just solve all your problems ;-)
 
Torben
Lost but trying
Profile
Posts: 25
Reg: Feb 10, 2011
Denmark / Germa...
250
like
03/20/11 02:40 AM (14 years ago)
@david i changed the line 302 in BT_fileManager.m from: if(![stringData writeToFile:[self getFilePath:fileName] atomically:YES encoding:encodingFlag error:&error]){ to: if(![stringData writeToFile:[self getFilePath:fileName] atomically:YES encoding:9 error:&error]){ greetings Torben
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/20/11 02:51 AM (14 years ago)
This is good. HOWEVER, it just means that everytime BT_fileManager is asked to save a file it will save it with that encoding. This is probably not a good idea? Example: What happens if the file you're saving is not encoded with NSISOLatin2StringEncoding (#9). It may work for your needs but I'm thinking you'de be better off letting BT_fileManager save the data using the encoding it was passed (the variable, encodingFlag) instead of hard coding it. Then, becuase BT_downloader calls BT_fileManager almost everytime, put the 9 in BT_downloader where it now reads 4 (see previous post). Not sure really. I'm very very bad at understanding all the different character sets. I do understand the basics, and the theory but have ZERO experience working with anything other than NSASCIIStringEncoding and NSUTF8StringEncoding The idea behind calling a method like the saveStringDataToFile:(NSString *)stringData:(NSString *)fileName:(int)encodingFlag method is that you can 'send it' different instructions. Like 'save with this filie name and use this encoding' It just so happens that BT_downloader is sending it the instructions. As usual, hope this helps. night. (sorry, exhuasted, back tomorrow)
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
03/21/11 01:39 AM (14 years ago)
@ Torben. yes you got it right, but I use the flag 5 What you must remember is that you always have the correct character when saving in backend. when you go into the back next time you'll see a (?) instead of åäö.character. I hope that David and Co fixes so that you can save åäö in the backend.
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/21/11 01:46 AM (14 years ago)
Hi guys... really REALLY dumb question. How and the heck can I enter special characters using my keyboard? I realize this sounds silly, but, I need to be able to natually type the info and not use a 'character picker' or other special entry mechanism to get this worked out. My keyboard does not have a way to enter this stuff - what am I missing ;-)
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
03/21/11 02:05 AM (14 years ago)
Hihi on my keyboard, there are (åäö) characters. Can not you just copy the characters or write HTML code for åäö. ( å ) = Ã¥ ( ä ) = ä ( ö ) = ö or if you have a win PC (allergic) you can take a text doc and hold Alt and type 148 = ö as ascii table. look at www.asciitable.com Hope it works!
 
Torben
Lost but trying
Profile
Posts: 25
Reg: Feb 10, 2011
Denmark / Germa...
250
like
03/21/11 02:23 AM (14 years ago)
@david what kind of special characters do you need? maybe input source us. extended helps. tlt.its.psu.edu/suggestions/international/accents/codemacext.html normal shortcuts. nouilles.info/keyboard_shortcuts.html greetings torben PS: i decided to change the encodeflag in BT downloader. thanks to both of you!! :)
 
David @ buzztouch
buzztouch Evangelist
Profile
Posts: 6866
Reg: Jan 01, 2010
Monterey, CA
78,840
like
03/21/11 02:37 AM (14 years ago)
Awesome link - I'll be typing in 'Euro' in no time! This will help me do a bunch of tests on our end and figure out a long-term solution.
 
manimossen
I hate code!
Profile
Posts: 10
Reg: Jun 02, 2011
location unknow...
100
like
06/05/11 05:20 PM (14 years ago)
Mackimack I am a beginner in Xcode and Buzztouch. Can you please explain what you did (in swedish) to solve the problem with strange characters instead of åäö? I have a problem with my RSS feed from a Swedish web site. Tack på förhand
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
06/06/11 12:43 AM (14 years ago)
Hi Manimossen. which version do you use v1.4 or 1.5?
 
manimossen
I hate code!
Profile
Posts: 10
Reg: Jun 02, 2011
location unknow...
100
like
06/06/11 12:57 AM (14 years ago)
I am using v.15.
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
06/06/11 01:19 AM (14 years ago)
Then this no problems! Åäö funkar i 1.5.
 
manimossen
I hate code!
Profile
Posts: 10
Reg: Jun 02, 2011
location unknow...
100
like
06/06/11 01:34 AM (14 years ago)
I explain this in swedish. Det funkar i menylistan. Men den här feeden visar inte åäö - feed://www.adoptionscentrum.se/sv/Container/RSS/Nyheter/. Den kommer från episerver och har utf-8.
 
Mackimack
Apple Fan
Profile
Posts: 481
Reg: Dec 30, 2010
Sweden
14,310
like
06/06/11 01:49 AM (14 years ago)
Ok Bt kan inte styra över feedet. Den läser bara in XML-en. Jag kan tyvärr inte testa den feed i någon app idag. Men i morgon kan jag testa den. Jag tar det på engelska också. Ok Bt can not control the feed. It's only read the XML. I can not test your feed to day, but I can try it to morrow.
 
manimossen
I hate code!
Profile
Posts: 10
Reg: Jun 02, 2011
location unknow...
100
like
06/06/11 02:14 AM (14 years ago)
OK. Good idea to use english. Really nice of you testing the feed. It´s a pro bono project I´m working with. I have tested the feed with appmaker and it works fine. But I don´t want to use that service, Bt is outstanding. I also tested the feed i W3 validation service and it´s valid but it says the encoding is iso 8859-1. Maybe thats the problem? <?xml version=1.0 encoding=ISO-8859-1?>
 
manimossen
I hate code!
Profile
Posts: 10
Reg: Jun 02, 2011
location unknow...
100
like
06/07/11 01:19 AM (14 years ago)
@ Mackimack I have solved the problem. It was a simple encoding thing in the feed. I changed the encoding of the feed to utf-8 and now it looks OK. Thank you for your assistance.
 
Mattzatt
Apple Fan
Profile
Posts: 1
Reg: Nov 21, 2011
Norway
10
like
11/21/11 06:22 PM (14 years ago)
BT_filemanager I Can't even find that file, so can anybody guide me in the right direction, so that I possibly can see and use æøå... :p
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.