Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • two different encoding in one dataset

    Hi,

    I need to import data from a Microsoft SQL Server View. I do that using odbc. That works also great. Unfortunately, I have two variables with an encoding Problem. Both Variables are string that contain Umlaute in the german language (ä, ö, ü, ß). The weird thing is, that there are other variables containing Umlaute which are shown correctly. I used filefilter to change the encoding to utf-8, which corrected the two variables. But now all the others are not shown correctly anymore. Unicode analyze gave me the following output:

    Code:
    unicode analyze students_data1.txt
    
      File summary (before starting):
            1  file(s) specified
            1  file(s) to be examined ...
    
      File students_data1.txt (text file)
                 60496 lines in file
                  2069 lines ASCII
                   437 lines UTF-8
                 57990 lines need translation
    I also tried unicode translate, which ended with the same result as filefilter. Is there a way to only correct the two variables, without changing the entire dataset?

  • #2
    We need a data example for specific syntax suggestions but generally, you want to look at

    Code:
    help ustrfrom()
    help ustrto()
    and perhaps other ustr*() functions.

    Comment


    • #3
      Cross-posted at https://stackoverflow.com/questions/...-stata-dataset

      We ask that you tell us about cross-posting. In any case, it is rare to get a better answer on Stack Overflow than here. The number of people watching for Stata questions is less than here.

      In any case, daniel klein made a most important point. A data example is needed. here.

      Comment


      • #4
        Thanks daniel klein ustrfrom() was the missing piece. Also sorry for cross-posting, I was not aware, that I should have mentioned it.

        Comment


        • #5
          Good that you solved your problem!

          Otherwise please see https://www.statalist.org/forums/help#crossposting The forum's home page and the prompt on starting every new thread enjoin all members to read the FAQ Advice before posting.

          Comment

          Working...
          X