iOS encode string to unicode

Jace

I have a string that both have English letters and Japanese characters. I need to convert the Japanese characters to Unicode before transmitting the data to our server. I found a lot of topic converting to UTF-8 but I have not found anything when it comes to converting to Unicode.

Side note: I also notice that if I put the string in array and use NSLog to print the array, the Japanese text is printed in Unicode.

NSString *data = @"aさ";
NSArray *array = [NSArray arrayWithObjects: data, other data..., nil];
NSLog(@"%@", array);

This will print out: "a\U3055" for my string data inside the array.

Sport
NSData *dataenc = [data dataUsingEncoding:NSNonLossyASCIIStringEncoding];
NSString *encodevalue = [[NSString alloc]initWithData:dataenc encoding:NSUTF8StringEncoding];

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Encode Unicode String to Base64 with VBScript

From Dev

Why is Python trying to automatically encode my Unicode string?

From Dev

encode string in Python 3 without unicode \xc2 subsitution

From Dev

How to encode a unicode string to utf-8 in python?

From Dev

Why is Python trying to automatically encode my Unicode string?

From Dev

When to use unicode(string) and string.encode('utf-8') in python

From Dev

When to use unicode(string) and string.encode('utf-8') in python

From Dev

How to encode the string in to "windows-1252" using ios?

From Dev

How to encode the string in to "windows-1252" using ios?

From Dev

Rails 3.2.21 / ruby 1.9.3 how can I \u encode unicode chars within a string

From Dev

PHP - json_encode(string, JSON_UNESCAPED_UNICODE) not escaping czech chars

From Dev

Rails 3.2.21 / ruby 1.9.3 how can I \u encode unicode chars within a string

From Dev

How to encode bytes as a printable unicode string (like base64 for ascii)

From Dev

encode unicode characters to unicode escape sequences

From Dev

Unicode URL encode / decode with Python

From Dev

ElementTree Unicode Encode/Decode Error

From Dev

handling unicode encode errors in python

From Dev

How to do not encode unicode, javascript

From Dev

using ei_encode_string to encode a string

From Dev

Encode iOS Basic Authentication

From Dev

iOS - EncodeWithCoder - Encode Nil

From Dev

Encode iOS Basic Authentication

From Dev

UnicodeEncodeError: 'decimal' codec can't encode character u'\x00' in position 8: invalid decimal Unicode string

From Dev

UnicodeEncodeError: 'decimal' codec can't encode character u'\x00' in position 8: invalid decimal Unicode string

From Dev

How to uri-encode unicode strings in Racket

From Dev

Python Unicode hell: Decode and Encode not working

From Dev

Encode Unicode to iso8859-15 with Python

From Dev

Unicode encode error: 'latin-1' in Python

From Dev

How To Stop json_enocde To Encode Unicode?

Related Related

  1. 1

    Encode Unicode String to Base64 with VBScript

  2. 2

    Why is Python trying to automatically encode my Unicode string?

  3. 3

    encode string in Python 3 without unicode \xc2 subsitution

  4. 4

    How to encode a unicode string to utf-8 in python?

  5. 5

    Why is Python trying to automatically encode my Unicode string?

  6. 6

    When to use unicode(string) and string.encode('utf-8') in python

  7. 7

    When to use unicode(string) and string.encode('utf-8') in python

  8. 8

    How to encode the string in to "windows-1252" using ios?

  9. 9

    How to encode the string in to "windows-1252" using ios?

  10. 10

    Rails 3.2.21 / ruby 1.9.3 how can I \u encode unicode chars within a string

  11. 11

    PHP - json_encode(string, JSON_UNESCAPED_UNICODE) not escaping czech chars

  12. 12

    Rails 3.2.21 / ruby 1.9.3 how can I \u encode unicode chars within a string

  13. 13

    How to encode bytes as a printable unicode string (like base64 for ascii)

  14. 14

    encode unicode characters to unicode escape sequences

  15. 15

    Unicode URL encode / decode with Python

  16. 16

    ElementTree Unicode Encode/Decode Error

  17. 17

    handling unicode encode errors in python

  18. 18

    How to do not encode unicode, javascript

  19. 19

    using ei_encode_string to encode a string

  20. 20

    Encode iOS Basic Authentication

  21. 21

    iOS - EncodeWithCoder - Encode Nil

  22. 22

    Encode iOS Basic Authentication

  23. 23

    UnicodeEncodeError: 'decimal' codec can't encode character u'\x00' in position 8: invalid decimal Unicode string

  24. 24

    UnicodeEncodeError: 'decimal' codec can't encode character u'\x00' in position 8: invalid decimal Unicode string

  25. 25

    How to uri-encode unicode strings in Racket

  26. 26

    Python Unicode hell: Decode and Encode not working

  27. 27

    Encode Unicode to iso8859-15 with Python

  28. 28

    Unicode encode error: 'latin-1' in Python

  29. 29

    How To Stop json_enocde To Encode Unicode?

HotTag

Archive