:Özel Karakterler Bir iPhone uygulaması için SQLite kullanıyorum ve böyle bir sorgu kullanıyorum
NSString *query = [[NSString alloc] initWithFormat:@"INSERT INTO Courses (name, credits, web, tName, tSurname, tMail, tOffice) VALUES (\'%@\', \'%@\', \'%@\', \'%@\', \'%@\', \'%@\', \'%@\');", self.name, self.credits, self.web, self.tName, self.tSurname, self.tMail, self.tOffice];
Basit bir INSERT, ama ben İspanya'dan ve tildes ile bazı sorunlar yaşıyorum. i gibi bir şey yaparsanız:
INSERT INTO Courses (name, credits, web, tName, tSurname, tMail, tOffice) VALUES ('test', 'test', 'test', 'test', 'test', 'test', 'test');", self.name, self.credits, self.web, self.tName, self.tSurname, self.tMail, self.tOffice];
Tüm mükemmel çalışır. S sorgusu ise: Ben ñ gibi "özel karakter" ¿, ¡, `', iki veya daha fazla kelime ile bir ekleme yapmak ... Ve ben bunu düzeltmek için nasıl bilmiyorum zaman
sorun haline gelir sadece özel bir karakter içerir, sorun yoktur.
Bu sorgu çalışıyor (sadece bir "á" olduğundan):
INSERT INTO Courses (name, credits, web, tName, tSurname, tMail, tOffice) VALUES ('Matemáticas', '1', '', 'Name', 'Surname', '[email protected]', '');", self.name, self.credits, self.web, self.tName, self.tSurname, self.tMail, self.tOffice];
Bu sorgu bana hata verir Örneğin
"Hata: yakın " ''": sözdizimi hatası "(bir olduğundan 'ó' ve 'à'): ve
INSERT INTO Courses (name, credits, web, tName, tSurname, tMail, tOffice) VALUES ('Gestió', '1', '', 'à', 'Surname', '[email protected]', '');", self.name, self.credits, self.web, self.tName, self.tSurname, self.tMail, self.tOffice];
ben arasında kelime koymak için çalıştı" ve ben de aynısını alıyorum.
Herhangi bir fikrin var mı?
Merhaba, bu soruna kesin bir çözüm buldunuz mu, son üç gün içinde de aynı şekilde çalışıyorum. –
henüz üzgünüz – llKoull